<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
    <version>5.0</version>
    <date>2024-04-06T09:07:46Z</date>
    <groups>
        <group>
            <name>Templates/Server hardware</name>
        </group>
    </groups>
    <templates>
        <template>
            <template>Graviton by HTTP</template>
            <name>Graviton by HTTP</name>
            <description>Template for monitoring Graviton BMC by Redfish API&#13;
&#13;
By Maxim.M.Demichev</description>
            <groups>
                <group>
                    <name>Templates/Server hardware</name>
                </group>
            </groups>
            <applications>
                <application>
                    <name>disk_drives</name>
                </application>
                <application>
                    <name>ethernet</name>
                </application>
                <application>
                    <name>fans</name>
                </application>
                <application>
                    <name>logical_volumes</name>
                </application>
                <application>
                    <name>memory</name>
                </application>
                <application>
                    <name>network_adapters</name>
                </application>
                <application>
                    <name>power</name>
                </application>
                <application>
                    <name>power_supplies</name>
                </application>
                <application>
                    <name>processors</name>
                </application>
                <application>
                    <name>raw</name>
                </application>
                <application>
                    <name>storage</name>
                </application>
                <application>
                    <name>storage_controllers</name>
                </application>
                <application>
                    <name>system</name>
                </application>
                <application>
                    <name>temperature</name>
                </application>
                <application>
                    <name>thermal</name>
                </application>
                <application>
                    <name>voltage</name>
                </application>
            </applications>
            <items>
                <item>
                    <name>Drives Sensors</name>
                    <type>DEPENDENT</type>
                    <key>graviton.sensors.drives</key>
                    <delay>0</delay>
                    <history>0</history>
                    <trends>0</trends>
                    <value_type>TEXT</value_type>
                    <description>Сенсоры дисков</description>
                    <applications>
                        <application>
                            <name>disk_drives</name>
                        </application>
                        <application>
                            <name>storage</name>
                        </application>
                    </applications>
                    <preprocessing>
                        <step>
                            <type>JAVASCRIPT</type>
                            <params>function request(url) {
    api_request = new CurlHttpRequest();
    api_request.AddHeader('Authorization: Basic ' + btoa(params.user + ':' + params.password));
    Zabbix.Log(4, '[ GRAVITON ] Sending request: ' + url);

    try {
        response = api_request.Get(url);
    } catch (error) {
        Zabbix.Log(4, '[ GRAVITON ] Get request returned error ' + error);
        throw 'Get request returned error ' + error + '. Check debug log for more information.';
    }

    Zabbix.Log(4, '[ GRAVITON ] Received response with status code ' +
        api_request.Status() + '\n' + response);

    if (api_request.Status() !== 200) {
        var message = 'Request failed with status code ' + api_request.Status();
        if (response !== null) {
            if (typeof response.message === 'string') {
                message += ': ' + response.message;
            }
        }

        throw message + ' Check debug log for more information.';
    }

    if (response !== null) {
        try {
            response = JSON.parse(response);
        }
        catch (error) {
            Zabbix.Log(4, '[ GRAVITON ] Failed to parse response.');
            response = null;
        }
    }

    return {
        status: api_request.Status(),
        body: response
    };
}

function getField(object, field, def) {
    var names = field.split('.');
    var name = names.shift();

    while (typeof name !== 'undefined') {
        if (typeof object === undefined || typeof object[name] === 'undefined') {
            return def;
        }

        object = object[name];
        name = names.shift();
    }

    return object;
}

try {
    sensors = JSON.parse(value);
}
catch (error) {
    Zabbix.Log(4, '[ GRAVITON ] Failed to parse response.');
    sensors = null;
}

var params = {
    url: '{$API.URL}',
    user: '{$API.USER}',
    password: '{$API.PASSWORD}'
};

var result = [];

var storage_units = sensors;

if (storage_units instanceof Array) {
    storage_units.forEach(function (storage_unit) {
        var storage_unit_name = storage_unit.body.Name;

        if (storage_unit.body.Drives instanceof Array) {
            storage_unit.body.Drives.forEach(function (drive) {
                response = request(params.url + drive[&quot;@odata.id&quot;]);
                result.push({
                    'StorageUnit': storage_unit_name, 
                    'Name': response.body.Name, 
                    'Model': response.body.Model, 
                    'CapacityBytes': response.body.CapacityBytes,
                    'Health': response.body.Status.Health, 
                    'State': response.body.Status.State
                });
            });
        }
    });
}

return JSON.stringify(result);</params>
                        </step>
                    </preprocessing>
                    <master_item>
                        <key>graviton.sensors.storage</key>
                    </master_item>
                </item>
                <item>
                    <name>Graviton: Get Ethernet Sensors</name>
                    <type>HTTP_AGENT</type>
                    <key>graviton.sensors.ethernet</key>
                    <delay>5m</delay>
                    <history>0</history>
                    <trends>0</trends>
                    <value_type>TEXT</value_type>
                    <authtype>BASIC</authtype>
                    <username>{$API.USER}</username>
                    <password>{$API.PASSWORD}</password>
                    <description>Сенсоры интерфейсов Ethernet</description>
                    <applications>
                        <application>
                            <name>ethernet</name>
                        </application>
                        <application>
                            <name>raw</name>
                        </application>
                    </applications>
                    <preprocessing>
                        <step>
                            <type>JAVASCRIPT</type>
                            <params>function request(url) {
    api_request = new CurlHttpRequest();
    api_request.AddHeader('Authorization: Basic ' + btoa(params.user + ':' + params.password));
    Zabbix.Log(4, '[ GRAVITON ] Sending request: ' + url);

    try {
        response = api_request.Get(url);
    } catch (error) {
        Zabbix.Log(4, '[ GRAVITON ] Get request returned error ' + error);
        throw 'Get request returned error ' + error + '. Check debug log for more information.';
    }

    Zabbix.Log(4, '[ GRAVITON ] Received response with status code ' +
        api_request.Status() + '\n' + response);

    if (api_request.Status() !== 200) {
        var message = 'Request failed with status code ' + api_request.Status();
        if (response !== null) {
            if (typeof response.message === 'string') {
                message += ': ' + response.message;
            }
        }

        throw message + ' Check debug log for more information.';
    }

    if (response !== null) {
        try {
            response = JSON.parse(response);
        }
        catch (error) {
            Zabbix.Log(4, '[ GRAVITON ] Failed to parse response.');
            response = null;
        }
    }

    return {
        status: api_request.Status(),
        body: response
    };
}

try {
    sensors = JSON.parse(value);
}
catch (error) {
    Zabbix.Log(4, '[ GRAVITON ] Failed to parse response.');
    sensors = null;
}

var params = {
    url: '{$API.URL}',
    user: '{$API.USER}',
    password: '{$API.PASSWORD}'
};
var result = [];

var index = params.url.indexOf('://');
index = params.url.indexOf('/', (index !== -1) ? (index + 3) : 0);
if (index !== -1) {
    params.url = params.url.substring(0, index);
}

if (sensors.Members instanceof Array) {
    sensors.Members.forEach(function (sensor) {
        if (typeof sensor[&quot;@odata.id&quot;] === 'string') {
            response = request(params.url + sensor[&quot;@odata.id&quot;]);
            if (true) {
                if (typeof response.body.Name === 'string') {
                    result.push({ 
                      'Name': response.body.Name, 
                      'LinkStatus': response.body.LinkStatus,
                      'Health': response.body.Status.Health, 
                      'State': response.body.Status.State
                    });
                }
            }
        }
    });
}

return JSON.stringify(result);</params>
                        </step>
                    </preprocessing>
                    <timeout>30s</timeout>
                    <url>{$API.URL}/redfish/v1/Systems/Self/EthernetInterfaces</url>
                </item>
                <item>
                    <name>Fan Sensors</name>
                    <type>DEPENDENT</type>
                    <key>graviton.sensors.fans</key>
                    <delay>0</delay>
                    <history>0</history>
                    <trends>0</trends>
                    <value_type>TEXT</value_type>
                    <description>Сенсоры вентиляторов</description>
                    <applications>
                        <application>
                            <name>fans</name>
                        </application>
                        <application>
                            <name>thermal</name>
                        </application>
                    </applications>
                    <preprocessing>
                        <step>
                            <type>JAVASCRIPT</type>
                            <params>function getField(object, field, def) {
    var names = field.split('.');
    var name = names.shift();

    while (typeof name !== 'undefined') {
        if (typeof object === undefined || typeof object[name] === 'undefined') {
            return def;
        }

        object = object[name];
        name = names.shift();
    }

    return object;
}

try {
    sensors = JSON.parse(value);
}
catch (error) {
    Zabbix.Log(4, '[ GRAVITON ] Failed to parse response.');
    sensors = null;
}

var result = [];

if (sensors.Fans instanceof Array) {
    sensors.Fans.forEach(function (sensor) {
        if (typeof sensor[&quot;@odata.id&quot;] === 'string') {
            if (getField(sensor, 'PhysicalContext', '') === 'Fan') {
                result.push(
                  { 
                    'Name': getField(sensor, 'Name', ''),
                    'LowerThresholdCritical': getField(sensor, 'LowerThresholdCritical', ''),
                    'LowerThresholdFatal': getField(sensor, 'LowerThresholdFatal', ''),
                    'LowerThresholdNonCritical': getField(sensor, 'LowerThresholdNonCritical', ''),
                    'UpperThresholdCritical': getField(sensor, 'UpperThresholdCritical', ''),
                    'UpperThresholdFatal': getField(sensor, 'UpperThresholdFatal', ''),
                    'UpperThresholdNonCritical': getField(sensor, 'UpperThresholdNonCritical', ''),
                    'Reading': getField(sensor, 'Reading', ''),
                    'Health': getField(sensor, 'Status.Health', ''),
                    'State': getField(sensor, 'Status.State', '')
                  }
                );
            }
        }
    });
}

return JSON.stringify(result);</params>
                        </step>
                    </preprocessing>
                    <master_item>
                        <key>graviton.sensors.thermal</key>
                    </master_item>
                </item>
                <item>
                    <name>Graviton: Get Memory Sensors</name>
                    <type>HTTP_AGENT</type>
                    <key>graviton.sensors.memory</key>
                    <delay>5m</delay>
                    <history>0</history>
                    <trends>0</trends>
                    <value_type>TEXT</value_type>
                    <authtype>BASIC</authtype>
                    <username>{$API.USER}</username>
                    <password>{$API.PASSWORD}</password>
                    <description>Сенсоры оперативной памяти</description>
                    <applications>
                        <application>
                            <name>memory</name>
                        </application>
                        <application>
                            <name>raw</name>
                        </application>
                    </applications>
                    <preprocessing>
                        <step>
                            <type>JAVASCRIPT</type>
                            <params>function request(url) {
    api_request = new CurlHttpRequest();
    api_request.AddHeader('Authorization: Basic ' + btoa(params.user + ':' + params.password));
    Zabbix.Log(4, '[ GRAVITON ] Sending request: ' + url);

    try {
        response = api_request.Get(url);
    } catch (error) {
        Zabbix.Log(4, '[ GRAVITON ] Get request returned error ' + error);
        throw 'Get request returned error ' + error + '. Check debug log for more information.';
    }

    Zabbix.Log(4, '[ GRAVITON ] Received response with status code ' +
        api_request.Status() + '\n' + response);

    if (api_request.Status() !== 200) {
        var message = 'Request failed with status code ' + api_request.Status();
        if (response !== null) {
            if (typeof response.message === 'string') {
                message += ': ' + response.message;
            }
        }

        throw message + ' Check debug log for more information.';
    }

    if (response !== null) {
        try {
            response = JSON.parse(response);
        }
        catch (error) {
            Zabbix.Log(4, '[ GRAVITON ] Failed to parse response.');
            response = null;
        }
    }

    return {
        status: api_request.Status(),
        body: response
    };
}

try {
    sensors = JSON.parse(value);
}
catch (error) {
    Zabbix.Log(4, '[ GRAVITON ] Failed to parse response.');
    sensors = null;
}

var params = {
    url: '{$API.URL}',
    user: '{$API.USER}',
    password: '{$API.PASSWORD}'
};
var result = [];

var index = params.url.indexOf('://');
index = params.url.indexOf('/', (index !== -1) ? (index + 3) : 0);
if (index !== -1) {
    params.url = params.url.substring(0, index);
}

if (sensors.Members instanceof Array) {
    sensors.Members.forEach(function (sensor) {
        if (typeof sensor[&quot;@odata.id&quot;] === 'string') {
            response = request(params.url + sensor[&quot;@odata.id&quot;]);
            if (true) {
                if (typeof response.body.Name === 'string') {
                    result.push({ 
                      'Name': response.body.Name, 
                      'CapacityMiB': response.body.CapacityMiB,
                      'Health': response.body.Status.Health, 
                      'State': response.body.Status.State
                    });
                }
            }
        }
    });
}

return JSON.stringify(result);</params>
                        </step>
                    </preprocessing>
                    <timeout>30s</timeout>
                    <url>{$API.URL}/redfish/v1/Systems/Self/Memory</url>
                </item>
                <item>
                    <name>Graviton: Get Network Adapter Sensors</name>
                    <type>HTTP_AGENT</type>
                    <key>graviton.sensors.net_adapters</key>
                    <delay>5m</delay>
                    <history>0</history>
                    <trends>0</trends>
                    <value_type>TEXT</value_type>
                    <authtype>BASIC</authtype>
                    <username>{$API.USER}</username>
                    <password>{$API.PASSWORD}</password>
                    <description>Сенсоры сетевых адаптеров</description>
                    <applications>
                        <application>
                            <name>network_adapters</name>
                        </application>
                        <application>
                            <name>raw</name>
                        </application>
                    </applications>
                    <preprocessing>
                        <step>
                            <type>JAVASCRIPT</type>
                            <params>function request(url) {
    api_request = new CurlHttpRequest();
    api_request.AddHeader('Authorization: Basic ' + btoa(params.user + ':' + params.password));
    Zabbix.Log(4, '[ GRAVITON ] Sending request: ' + url);

    try {
        response = api_request.Get(url);
    } catch (error) {
        Zabbix.Log(4, '[ GRAVITON ] Get request returned error ' + error);
        throw 'Get request returned error ' + error + '. Check debug log for more information.';
    }

    Zabbix.Log(4, '[ GRAVITON ] Received response with status code ' +
        api_request.Status() + '\n' + response);

    if (api_request.Status() !== 200) {
        var message = 'Request failed with status code ' + api_request.Status();
        if (response !== null) {
            if (typeof response.message === 'string') {
                message += ': ' + response.message;
            }
        }

        throw message + ' Check debug log for more information.';
    }

    if (response !== null) {
        try {
            response = JSON.parse(response);
        }
        catch (error) {
            Zabbix.Log(4, '[ GRAVITON ] Failed to parse response.');
            response = null;
        }
    }

    return {
        status: api_request.Status(),
        body: response
    };
}

try {
    sensors = JSON.parse(value);
}
catch (error) {
    Zabbix.Log(4, '[ GRAVITON ] Failed to parse response.');
    sensors = null;
}

var params = {
    url: '{$API.URL}',
    user: '{$API.USER}',
    password: '{$API.PASSWORD}'
};
var result = [];

var index = params.url.indexOf('://');
index = params.url.indexOf('/', (index !== -1) ? (index + 3) : 0);
if (index !== -1) {
    params.url = params.url.substring(0, index);
}

if (sensors.Members instanceof Array) {
    sensors.Members.forEach(function (sensor) {
        if (typeof sensor[&quot;@odata.id&quot;] === 'string') {
            response = request(params.url + sensor[&quot;@odata.id&quot;]);
            if (true) {
                if (typeof response.body.Name === 'string') {
                    result.push({ 
                      'Name': response.body.Name, 
                      'LinkStatus': response.body.LinkStatus,
                      'Health': response.body.Status.Health, 
                      'State': response.body.Status.State
                    });
                }
            }
        }
    });
}

return JSON.stringify(result);</params>
                        </step>
                    </preprocessing>
                    <timeout>30s</timeout>
                    <url>{$API.URL}/redfish/v1/Chassis/Self/NetworkAdapters</url>
                </item>
                <item>
                    <name>Graviton: Get Power Sensors</name>
                    <type>HTTP_AGENT</type>
                    <key>graviton.sensors.power</key>
                    <delay>5m</delay>
                    <history>0</history>
                    <trends>0</trends>
                    <value_type>TEXT</value_type>
                    <authtype>BASIC</authtype>
                    <username>{$API.USER}</username>
                    <password>{$API.PASSWORD}</password>
                    <description>Сенсоры электропитания</description>
                    <applications>
                        <application>
                            <name>power</name>
                        </application>
                        <application>
                            <name>raw</name>
                        </application>
                    </applications>
                    <timeout>30s</timeout>
                    <url>{$API.URL}/redfish/v1/Chassis/Self/Power</url>
                </item>
                <item>
                    <name>Power Supplies Sensors</name>
                    <type>DEPENDENT</type>
                    <key>graviton.sensors.power_supplies</key>
                    <delay>0</delay>
                    <history>0</history>
                    <trends>0</trends>
                    <value_type>TEXT</value_type>
                    <description>Сенсоры источников питания</description>
                    <applications>
                        <application>
                            <name>power</name>
                        </application>
                        <application>
                            <name>power_supplies</name>
                        </application>
                    </applications>
                    <preprocessing>
                        <step>
                            <type>JAVASCRIPT</type>
                            <params>function getField(object, field, def) {
    var names = field.split('.');
    var name = names.shift();

    while (typeof name !== 'undefined') {
        if (typeof object === undefined || typeof object[name] === 'undefined') {
            return def;
        }

        object = object[name];
        name = names.shift();
    }

    return object;
}

try {
    sensors = JSON.parse(value);
}
catch (error) {
    Zabbix.Log(4, '[ GRAVITON ] Failed to parse response.');
    sensors = null;
}

var result = [];

if (sensors.PowerSupplies instanceof Array) {
    sensors.PowerSupplies.forEach(function (sensor) {
        if (typeof sensor[&quot;@odata.id&quot;] === 'string') {
            if (true) {
                result.push(
                  { 
                    'Name': getField(sensor, 'Name', ''),
                    'Fan_1': getField(sensor, 'Fan_1', ''),
                    'Fan_2': getField(sensor, 'Fan_2', ''),
                    'LineInputCurrent': getField(sensor, 'LineInputCurrent', ''),
                    'LineInputVoltage': getField(sensor, 'LineInputVoltage', ''),
                    'LineInputWatts': getField(sensor, 'LineInputWatts', ''),
                    'PowerCapacityCurrent': getField(sensor, 'PowerCapacityCurrent', ''),
                    'PowerCapacityVoltage': getField(sensor, 'PowerCapacityVoltage', ''),
                    'PowerCapacityWatts': getField(sensor, 'PowerCapacityWatts', ''),
                    'PowerOutputCurrent': getField(sensor, 'PowerOutputCurrent', ''),
                    'PowerOutputVoltage': getField(sensor, 'PowerOutputVoltage', ''),
                    'PowerOutputWatts': getField(sensor, 'PowerOutputWatts', ''),
                    'Temperature_1': getField(sensor, 'Temperature_1', ''),
                    'Temperature_2': getField(sensor, 'Temperature_2', ''),
                    'Health': getField(sensor, 'Status.Health', ''),
                    'Health': getField(sensor, 'Status.Health', ''),
                    'State': getField(sensor, 'Status.State', '')
                  }
                );
            }
        }
    });
}

return JSON.stringify(result);</params>
                        </step>
                    </preprocessing>
                    <master_item>
                        <key>graviton.sensors.power</key>
                    </master_item>
                </item>
                <item>
                    <name>Graviton: Get Processors Sensors</name>
                    <type>HTTP_AGENT</type>
                    <key>graviton.sensors.processors</key>
                    <delay>5m</delay>
                    <history>0</history>
                    <trends>0</trends>
                    <value_type>TEXT</value_type>
                    <authtype>BASIC</authtype>
                    <username>{$API.USER}</username>
                    <password>{$API.PASSWORD}</password>
                    <description>Сенсоры процессоров</description>
                    <applications>
                        <application>
                            <name>processors</name>
                        </application>
                        <application>
                            <name>raw</name>
                        </application>
                    </applications>
                    <preprocessing>
                        <step>
                            <type>JAVASCRIPT</type>
                            <params>function request(url) {
    api_request = new CurlHttpRequest();
    api_request.AddHeader('Authorization: Basic ' + btoa(params.user + ':' + params.password));
    Zabbix.Log(4, '[ GRAVITON ] Sending request: ' + url);

    try {
        response = api_request.Get(url);
    } catch (error) {
        Zabbix.Log(4, '[ GRAVITON ] Get request returned error ' + error);
        throw 'Get request returned error ' + error + '. Check debug log for more information.';
    }

    Zabbix.Log(4, '[ GRAVITON ] Received response with status code ' +
        api_request.Status() + '\n' + response);

    if (api_request.Status() !== 200) {
        var message = 'Request failed with status code ' + api_request.Status();
        if (response !== null) {
            if (typeof response.message === 'string') {
                message += ': ' + response.message;
            }
        }

        throw message + ' Check debug log for more information.';
    }

    if (response !== null) {
        try {
            response = JSON.parse(response);
        }
        catch (error) {
            Zabbix.Log(4, '[ GRAVITON ] Failed to parse response.');
            response = null;
        }
    }

    return {
        status: api_request.Status(),
        body: response
    };
}

try {
    sensors = JSON.parse(value);
}
catch (error) {
    Zabbix.Log(4, '[ GRAVITON ] Failed to parse response.');
    sensors = null;
}

var params = {
    url: '{$API.URL}',
    user: '{$API.USER}',
    password: '{$API.PASSWORD}'
};
var result = [];

var index = params.url.indexOf('://');
index = params.url.indexOf('/', (index !== -1) ? (index + 3) : 0);
if (index !== -1) {
    params.url = params.url.substring(0, index);
}


if (sensors.Members instanceof Array) {
    // Проходка в цикле по всем Storage Unit

    sensors.Members.forEach(function (sensor) {
        // Для каждого Storage Unit выполняем отдельный запрос на получение его сенсоров

        if (typeof sensor[&quot;@odata.id&quot;] === 'string') {
            var response = request(params.url + sensor[&quot;@odata.id&quot;]);
            if (true) {
                if (typeof response.body.Name === 'string') {
                    result.push({ 
                      'Name': response.body.Name, 
                      'Model': response.body.Model,
                      'TotalCores': response.body.TotalCores, 
                      'TotalThreads': response.body.TotalThreads,
                      'Health': response.body.Status.Health, 
                      'State': response.body.Status.State
                    });
                }
            }
        }
    });
}

return JSON.stringify(result);</params>
                        </step>
                    </preprocessing>
                    <timeout>30s</timeout>
                    <url>{$API.URL}/redfish/v1/Systems/Self/Processors</url>
                </item>
                <item>
                    <name>Graviton: Get Storage Sensors</name>
                    <type>HTTP_AGENT</type>
                    <key>graviton.sensors.storage</key>
                    <delay>5m</delay>
                    <history>0</history>
                    <trends>0</trends>
                    <value_type>TEXT</value_type>
                    <authtype>BASIC</authtype>
                    <username>{$API.USER}</username>
                    <password>{$API.PASSWORD}</password>
                    <description>Сенсоры систем хранения данных</description>
                    <applications>
                        <application>
                            <name>raw</name>
                        </application>
                        <application>
                            <name>storage</name>
                        </application>
                    </applications>
                    <preprocessing>
                        <step>
                            <type>JAVASCRIPT</type>
                            <params>function request(url) {
    api_request = new CurlHttpRequest();
    api_request.AddHeader('Authorization: Basic ' + btoa(params.user + ':' + params.password));
    Zabbix.Log(4, '[ GRAVITON ] Sending request: ' + url);

    try {
        response = api_request.Get(url);
    } catch (error) {
        Zabbix.Log(4, '[ GRAVITON ] Get request returned error ' + error);
        throw 'Get request returned error ' + error + '. Check debug log for more information.';
    }

    Zabbix.Log(4, '[ GRAVITON ] Received response with status code ' +
        api_request.Status() + '\n' + response);

    if (api_request.Status() !== 200) {
        var message = 'Request failed with status code ' + api_request.Status();
        if (response !== null) {
            if (typeof response.message === 'string') {
                message += ': ' + response.message;
            }
        }

        throw message + ' Check debug log for more information.';
    }

    if (response !== null) {
        try {
            response = JSON.parse(response);
        }
        catch (error) {
            Zabbix.Log(4, '[ GRAVITON ] Failed to parse response.');
            response = null;
        }
    }

    return {
        status: api_request.Status(),
        body: response
    };
}

try {
    sensors = JSON.parse(value);
}
catch (error) {
    Zabbix.Log(4, '[ GRAVITON ] Failed to parse response.');
    sensors = null;
}

var params = {
    url: '{$API.URL}',
    user: '{$API.USER}',
    password: '{$API.PASSWORD}'
};
var result = [];

var index = params.url.indexOf('://');
index = params.url.indexOf('/', (index !== -1) ? (index + 3) : 0);
if (index !== -1) {
    params.url = params.url.substring(0, index);
}


if (sensors.Members instanceof Array) {
    // Проходка в цикле по всем Storage Unit

    sensors.Members.forEach(function (sensor) {
        // Для каждого Storage Unit выполняем отдельный запрос на получение его сенсоров

        if (typeof sensor[&quot;@odata.id&quot;] === 'string') {
            var response = request(params.url + sensor[&quot;@odata.id&quot;]);
            result.push(response);
        }
    });
}

return JSON.stringify(result);</params>
                        </step>
                    </preprocessing>
                    <timeout>30s</timeout>
                    <url>{$API.URL}/redfish/v1/Systems/Self/Storage</url>
                </item>
                <item>
                    <name>Storage Controllers Sensors</name>
                    <type>DEPENDENT</type>
                    <key>graviton.sensors.storage_controllers</key>
                    <delay>0</delay>
                    <history>0</history>
                    <trends>0</trends>
                    <value_type>TEXT</value_type>
                    <description>Сенсоры контроллеров СХД</description>
                    <applications>
                        <application>
                            <name>storage</name>
                        </application>
                        <application>
                            <name>storage_controllers</name>
                        </application>
                    </applications>
                    <preprocessing>
                        <step>
                            <type>JAVASCRIPT</type>
                            <params>function getField(object, field, def) {
    var names = field.split('.');
    var name = names.shift();

    while (typeof name !== 'undefined') {
        if (typeof object === undefined || typeof object[name] === 'undefined') {
            return def;
        }

        object = object[name];
        name = names.shift();
    }

    return object;
}

try {
    sensors = JSON.parse(value);
}
catch (error) {
    Zabbix.Log(4, '[ GRAVITON ] Failed to parse response.');
    sensors = null;
}

var result = [];



var storage_units = sensors;

if (storage_units instanceof Array) {
    storage_units.forEach(function (storage_unit) {
        var storage_unit_name = storage_unit.body.Name;

        if (storage_unit.body.StorageControllers instanceof Array) {
            storage_unit.body.StorageControllers.forEach(function (sensor) {
                if (typeof sensor[&quot;@odata.id&quot;] === 'string') {
                    if (true) {
                        result.push(
                          { 
                            'Name': getField(sensor, 'Name', ''),
                            'Health': getField(sensor, 'Status.Health', ''),
                            'State': getField(sensor, 'Status.State', '')
                          }
                        );
                    }
                }
            });
        }
    });
}


return JSON.stringify(result);</params>
                        </step>
                    </preprocessing>
                    <master_item>
                        <key>graviton.sensors.storage</key>
                    </master_item>
                </item>
                <item>
                    <name>Temperature Sensors</name>
                    <type>DEPENDENT</type>
                    <key>graviton.sensors.temp</key>
                    <delay>0</delay>
                    <history>0</history>
                    <trends>0</trends>
                    <value_type>TEXT</value_type>
                    <description>Сенсоры вентиляторов</description>
                    <applications>
                        <application>
                            <name>temperature</name>
                        </application>
                        <application>
                            <name>thermal</name>
                        </application>
                    </applications>
                    <preprocessing>
                        <step>
                            <type>JAVASCRIPT</type>
                            <params>function getField(object, field, def) {
    var names = field.split('.');
    var name = names.shift();

    while (typeof name !== 'undefined') {
        if (typeof object === undefined || typeof object[name] === 'undefined') {
            return def;
        }

        object = object[name];
        name = names.shift();
    }

    return object;
}

try {
    sensors = JSON.parse(value);
}
catch (error) {
    Zabbix.Log(4, '[ GRAVITON ] Failed to parse response.');
    sensors = null;
}

var result = [];

if (sensors.Temperatures instanceof Array) {
    sensors.Temperatures.forEach(function (sensor) {
        if (typeof sensor[&quot;@odata.id&quot;] === 'string') {
            if (true) {
                result.push(
                  { 
                    'Name': getField(sensor, 'Name', ''),
                    'LowerThresholdCritical': getField(sensor, 'LowerThresholdCritical', ''),
                    'LowerThresholdFatal': getField(sensor, 'LowerThresholdFatal', ''),
                    'LowerThresholdNonCritical': getField(sensor, 'LowerThresholdNonCritical', ''),
                    'UpperThresholdCritical': getField(sensor, 'UpperThresholdCritical', ''),
                    'UpperThresholdFatal': getField(sensor, 'UpperThresholdFatal', ''),
                    'UpperThresholdNonCritical': getField(sensor, 'UpperThresholdNonCritical', ''),
                    'ReadingCelsius': getField(sensor, 'ReadingCelsius', ''),
                    'Health': getField(sensor, 'Status.Health', ''),
                    'State': getField(sensor, 'Status.State', '')
                  }
                );
            }
        }
    });
}

return JSON.stringify(result);</params>
                        </step>
                    </preprocessing>
                    <master_item>
                        <key>graviton.sensors.thermal</key>
                    </master_item>
                </item>
                <item>
                    <name>Graviton: Get Thermal Sensors</name>
                    <type>HTTP_AGENT</type>
                    <key>graviton.sensors.thermal</key>
                    <delay>5m</delay>
                    <history>0</history>
                    <trends>0</trends>
                    <value_type>TEXT</value_type>
                    <authtype>BASIC</authtype>
                    <username>{$API.USER}</username>
                    <password>{$API.PASSWORD}</password>
                    <description>Сенсоры температуры и вентиляторов</description>
                    <applications>
                        <application>
                            <name>raw</name>
                        </application>
                        <application>
                            <name>thermal</name>
                        </application>
                    </applications>
                    <timeout>30s</timeout>
                    <url>{$API.URL}/redfish/v1/Chassis/Self/Thermal</url>
                </item>
                <item>
                    <name>Voltage Sensors</name>
                    <type>DEPENDENT</type>
                    <key>graviton.sensors.voltage</key>
                    <delay>0</delay>
                    <history>0</history>
                    <trends>0</trends>
                    <value_type>TEXT</value_type>
                    <description>Сенсоры напряжения</description>
                    <applications>
                        <application>
                            <name>power</name>
                        </application>
                        <application>
                            <name>voltage</name>
                        </application>
                    </applications>
                    <preprocessing>
                        <step>
                            <type>JAVASCRIPT</type>
                            <params>function getField(object, field, def) {
    var names = field.split('.');
    var name = names.shift();

    while (typeof name !== 'undefined') {
        if (typeof object === undefined || typeof object[name] === 'undefined') {
            return def;
        }

        object = object[name];
        name = names.shift();
    }

    return object;
}

try {
    sensors = JSON.parse(value);
}
catch (error) {
    Zabbix.Log(4, '[ GRAVITON ] Failed to parse response.');
    sensors = null;
}

var result = [];

if (sensors.Voltages instanceof Array) {
    sensors.Voltages.forEach(function (sensor) {
        if (typeof sensor[&quot;@odata.id&quot;] === 'string') {
            if (true) {
                result.push(
                  { 
                    'Name': getField(sensor, 'Name', ''),

                    'LowerThresholdCritical': getField(sensor, 'LowerThresholdCritical', ''),
                    'LowerThresholdFatal': getField(sensor, 'LowerThresholdFatal', ''),
                    'LowerThresholdNonCritical': getField(sensor, 'LowerThresholdNonCritical', ''),

                    'UpperThresholdCritical': getField(sensor, 'UpperThresholdCritical', ''),
                    'UpperThresholdFatal': getField(sensor, 'UpperThresholdFatal', ''),
                    'UpperThresholdNonCritical': getField(sensor, 'UpperThresholdNonCritical', ''),

                    'ReadingVolts': getField(sensor, 'ReadingVolts', ''),
                    'Health': getField(sensor, 'Status.Health', ''),
                    'State': getField(sensor, 'Status.State', '')
                  }
                );
            }
        }
    });
}

return JSON.stringify(result);</params>
                        </step>
                    </preprocessing>
                    <master_item>
                        <key>graviton.sensors.power</key>
                    </master_item>
                </item>
                <item>
                    <name>Volumes Sensors</name>
                    <type>DEPENDENT</type>
                    <key>graviton.sensors.volumes</key>
                    <delay>0</delay>
                    <history>0</history>
                    <trends>0</trends>
                    <value_type>TEXT</value_type>
                    <description>Сенсоры логических томов</description>
                    <applications>
                        <application>
                            <name>logical_volumes</name>
                        </application>
                        <application>
                            <name>storage</name>
                        </application>
                    </applications>
                    <preprocessing>
                        <step>
                            <type>JAVASCRIPT</type>
                            <params>function request(url) {
    api_request = new CurlHttpRequest();
    api_request.AddHeader('Authorization: Basic ' + btoa(params.user + ':' + params.password));
    Zabbix.Log(4, '[ GRAVITON ] Sending request: ' + url);

    try {
        response = api_request.Get(url);
    } catch (error) {
        Zabbix.Log(4, '[ GRAVITON ] Get request returned error ' + error);
        throw 'Get request returned error ' + error + '. Check debug log for more information.';
    }

    Zabbix.Log(4, '[ GRAVITON ] Received response with status code ' +
        api_request.Status() + '\n' + response);

    if (api_request.Status() !== 200) {
        var message = 'Request failed with status code ' + api_request.Status();
        if (response !== null) {
            if (typeof response.message === 'string') {
                message += ': ' + response.message;
            }
        }

        throw message + ' Check debug log for more information.';
    }

    if (response !== null) {
        try {
            response = JSON.parse(response);
        }
        catch (error) {
            Zabbix.Log(4, '[ GRAVITON ] Failed to parse response.');
            response = null;
        }
    }

    return {
        status: api_request.Status(),
        body: response
    };
}

function getField(object, field, def) {
    var names = field.split('.');
    var name = names.shift();

    while (typeof name !== 'undefined') {
        if (typeof object === undefined || typeof object[name] === 'undefined') {
            return def;
        }

        object = object[name];
        name = names.shift();
    }

    return object;
}

try {
    sensors = JSON.parse(value);
}
catch (error) {
    Zabbix.Log(4, '[ GRAVITON ] Failed to parse response.');
    sensors = null;
}

var params = {
    url: '{$API.URL}',
    user: '{$API.USER}',
    password: '{$API.PASSWORD}'
};

var result = [];

var storage_units = sensors;

if (storage_units instanceof Array) {
    storage_units.forEach(function (storage_unit) {
        var storage_unit_name = storage_unit.body.Name;
        
        // Предположительно на контроллере может существовать только одна коллекция вольюмов
        var volume_collection = storage_unit.body.Volumes[&quot;@odata.id&quot;];
        
        var response = request(params.url + volume_collection);
        if (response.body.Members instanceof Array) {
            response.body.Members.forEach(function (volume) {
                response = request(params.url + volume[&quot;@odata.id&quot;]);
                if (typeof response.body.Name === 'string') {
                    result.push({
                        'Storageunit': storage_unit_name, 
                        'Name': response.body.Name, 
                        'CapacityBytes': response.body.CapacityBytes,
                        'Health': response.body.Status.Health, 
                        'State': response.body.Status.State
                    });
                 }
             });
         }
    });
}

return JSON.stringify(result);</params>
                        </step>
                    </preprocessing>
                    <master_item>
                        <key>graviton.sensors.storage</key>
                    </master_item>
                </item>
                <item>
                    <name>Firmware version</name>
                    <type>DEPENDENT</type>
                    <key>graviton.server.firmware</key>
                    <delay>0</delay>
                    <history>7d</history>
                    <trends>0</trends>
                    <value_type>CHAR</value_type>
                    <applications>
                        <application>
                            <name>system</name>
                        </application>
                    </applications>
                    <preprocessing>
                        <step>
                            <type>JSONPATH</type>
                            <params>$.firmware</params>
                        </step>
                    </preprocessing>
                    <master_item>
                        <key>graviton.server.system</key>
                    </master_item>
                    <triggers>
                        <trigger>
                            <expression>{change()}=1</expression>
                            <name>Graviton server firmware version was changed to [{ITEM.VALUE}]</name>
                            <priority>INFO</priority>
                            <manual_close>YES</manual_close>
                            <tags>
                                <tag>
                                    <tag>component</tag>
                                    <value>system</value>
                                </tag>
                            </tags>
                        </trigger>
                    </triggers>
                </item>
                <item>
                    <name>Overall system health status</name>
                    <type>DEPENDENT</type>
                    <key>graviton.server.health</key>
                    <delay>0</delay>
                    <history>7d</history>
                    <trends>0</trends>
                    <value_type>CHAR</value_type>
                    <applications>
                        <application>
                            <name>system</name>
                        </application>
                    </applications>
                    <preprocessing>
                        <step>
                            <type>JSONPATH</type>
                            <params>$.status</params>
                        </step>
                    </preprocessing>
                    <master_item>
                        <key>graviton.server.system</key>
                    </master_item>
                    <triggers>
                        <trigger>
                            <expression>{change()}=1</expression>
                            <name>Graviton server health was changed to [{ITEM.VALUE}]</name>
                            <priority>WARNING</priority>
                            <manual_close>YES</manual_close>
                            <tags>
                                <tag>
                                    <tag>component</tag>
                                    <value>system</value>
                                </tag>
                            </tags>
                        </trigger>
                    </triggers>
                </item>
                <item>
                    <name>Hardware model name</name>
                    <type>DEPENDENT</type>
                    <key>graviton.server.hw.model</key>
                    <delay>0</delay>
                    <history>7d</history>
                    <trends>0</trends>
                    <value_type>CHAR</value_type>
                    <inventory_link>MODEL</inventory_link>
                    <applications>
                        <application>
                            <name>system</name>
                        </application>
                    </applications>
                    <preprocessing>
                        <step>
                            <type>JSONPATH</type>
                            <params>$.model</params>
                        </step>
                    </preprocessing>
                    <master_item>
                        <key>graviton.server.system</key>
                    </master_item>
                    <triggers>
                        <trigger>
                            <expression>{change()}=1</expression>
                            <name>Graviton server model was changed to [{ITEM.VALUE}]</name>
                            <priority>AVERAGE</priority>
                            <manual_close>YES</manual_close>
                            <tags>
                                <tag>
                                    <tag>component</tag>
                                    <value>system</value>
                                </tag>
                            </tags>
                        </trigger>
                    </triggers>
                </item>
                <item>
                    <name>Hardware serial number</name>
                    <type>DEPENDENT</type>
                    <key>graviton.server.hw.serialnumber</key>
                    <delay>0</delay>
                    <history>7d</history>
                    <trends>0</trends>
                    <value_type>CHAR</value_type>
                    <inventory_link>SERIALNO_A</inventory_link>
                    <applications>
                        <application>
                            <name>system</name>
                        </application>
                    </applications>
                    <preprocessing>
                        <step>
                            <type>JSONPATH</type>
                            <params>$.serialnumber</params>
                        </step>
                    </preprocessing>
                    <master_item>
                        <key>graviton.server.system</key>
                    </master_item>
                    <triggers>
                        <trigger>
                            <expression>{change()}=1</expression>
                            <name>Graviton server serial number was changed to [{ITEM.VALUE}]</name>
                            <priority>AVERAGE</priority>
                            <manual_close>YES</manual_close>
                            <tags>
                                <tag>
                                    <tag>component</tag>
                                    <value>system</value>
                                </tag>
                            </tags>
                        </trigger>
                    </triggers>
                </item>
                <item>
                    <name>Indicator LED State</name>
                    <type>DEPENDENT</type>
                    <key>graviton.server.indicator_led</key>
                    <delay>0</delay>
                    <history>7d</history>
                    <trends>0</trends>
                    <value_type>CHAR</value_type>
                    <applications>
                        <application>
                            <name>system</name>
                        </application>
                    </applications>
                    <preprocessing>
                        <step>
                            <type>JSONPATH</type>
                            <params>$.led</params>
                        </step>
                    </preprocessing>
                    <master_item>
                        <key>graviton.server.system</key>
                    </master_item>
                    <triggers>
                        <trigger>
                            <expression>{change()}=1</expression>
                            <name>Graviton LED state was changed to [{ITEM.VALUE}]</name>
                            <priority>WARNING</priority>
                            <type>MULTIPLE</type>
                            <manual_close>YES</manual_close>
                            <tags>
                                <tag>
                                    <tag>component</tag>
                                    <value>system</value>
                                </tag>
                            </tags>
                        </trigger>
                    </triggers>
                </item>
                <item>
                    <name>Overall system state</name>
                    <type>DEPENDENT</type>
                    <key>graviton.server.state</key>
                    <delay>0</delay>
                    <history>7d</history>
                    <trends>0</trends>
                    <value_type>CHAR</value_type>
                    <applications>
                        <application>
                            <name>system</name>
                        </application>
                    </applications>
                    <preprocessing>
                        <step>
                            <type>JSONPATH</type>
                            <params>$.state</params>
                        </step>
                    </preprocessing>
                    <master_item>
                        <key>graviton.server.system</key>
                    </master_item>
                    <triggers>
                        <trigger>
                            <expression>{last()}=&quot;Disabled&quot;</expression>
                            <name>Graviton server health was changed to [Disabled]</name>
                            <priority>AVERAGE</priority>
                            <manual_close>YES</manual_close>
                            <tags>
                                <tag>
                                    <tag>component</tag>
                                    <value>system</value>
                                </tag>
                            </tags>
                        </trigger>
                        <trigger>
                            <expression>{change()}=1</expression>
                            <name>Graviton server state was changed to [{ITEM.VALUE}]</name>
                            <priority>WARNING</priority>
                            <manual_close>YES</manual_close>
                            <dependencies>
                                <dependency>
                                    <name>Graviton server health was changed to [Disabled]</name>
                                    <expression>{Graviton by HTTP:graviton.server.state.last()}=&quot;Disabled&quot;</expression>
                                </dependency>
                            </dependencies>
                            <tags>
                                <tag>
                                    <tag>component</tag>
                                    <value>system</value>
                                </tag>
                            </tags>
                        </trigger>
                    </triggers>
                </item>
                <item>
                    <name>Overall system health status</name>
                    <type>DEPENDENT</type>
                    <key>graviton.server.status</key>
                    <delay>0</delay>
                    <history>7d</history>
                    <trends>0</trends>
                    <value_type>CHAR</value_type>
                    <applications>
                        <application>
                            <name>system</name>
                        </application>
                    </applications>
                    <preprocessing>
                        <step>
                            <type>JSONPATH</type>
                            <params>$.status</params>
                        </step>
                    </preprocessing>
                    <master_item>
                        <key>graviton.server.system</key>
                    </master_item>
                </item>
                <item>
                    <name>Graviton: Get System</name>
                    <type>HTTP_AGENT</type>
                    <key>graviton.server.system</key>
                    <delay>5m</delay>
                    <history>0</history>
                    <trends>0</trends>
                    <value_type>TEXT</value_type>
                    <authtype>BASIC</authtype>
                    <username>{$API.USER}</username>
                    <password>{$API.PASSWORD}</password>
                    <applications>
                        <application>
                            <name>raw</name>
                        </application>
                        <application>
                            <name>system</name>
                        </application>
                    </applications>
                    <preprocessing>
                        <step>
                            <type>JAVASCRIPT</type>
                            <params>function request(url) {
    api_request = new CurlHttpRequest();
    api_request.AddHeader('Authorization: Basic ' + btoa(params.user + ':' + params.password));
    Zabbix.Log(4, '[ GRAVITON ] Sending request: ' + url);

    try {
        response = api_request.Get(url);
    } catch (error) {
        Zabbix.Log(4, '[ GRAVITON ] Get request returned error ' + error);
        throw 'Get request returned error ' + error + '. Check debug log for more information.';
    }

    Zabbix.Log(4, '[ GRAVITON ] Received response with status code ' +
        api_request.Status() + '\n' + response);

    if (api_request.Status() !== 200) {
        var message = 'Request failed with status code ' + api_request.Status();
        if (response !== null) {
            if (typeof response.message === 'string') {
                message += ': ' + response.message;
            }
        }

        throw message + ' Check debug log for more information.';
    }

    if (response !== null) {
        try {
            response = JSON.parse(response);
        }
        catch (error) {
            Zabbix.Log(4, '[ GRAVITON ] Failed to parse response.');
            response = null;
        }
    }

    return {
        status: api_request.Status(),
        body: response
    };
}

function getField(object, field, def) {
    var names = field.split('.');
    var name = names.shift();

    while (typeof name !== 'undefined') {
        if (typeof object === undefined || typeof object[name] === 'undefined') {
            return def;
        }

        object = object[name];
        name = names.shift();
    }

    return object;
}

try {
    system = JSON.parse(value);
}
catch (error) {
    Zabbix.Log(4, '[ GRAVITON ] Failed to parse response.');
    system = null;
}

var params = {
    url: '{$API.URL}',
    user: '{$API.USER}',
    password: '{$API.PASSWORD}'
};
var result = {
    model: '',
    serialnumber: '',
    status: '',
    firmware: ''
};

var index = params.url.indexOf('://');
index = params.url.indexOf('/', (index !== -1) ? (index + 3) : 0);
if (index !== -1) {
    params.url = params.url.substring(0, index);
}

result.model = getField(system, 'Model', '');
result.serialnumber = getField(system, 'SerialNumber', '');
result.status = getField(system, 'Status.Health', '');
result.state = getField(system, 'Status.State', '');
result.led = getField(system, 'IndicatorLED', '');

response = request(params.url + '/redfish/v1/Managers/Self');
result.firmware = getField(response.body, 'FirmwareVersion', '');

return JSON.stringify(result);</params>
                        </step>
                    </preprocessing>
                    <timeout>30s</timeout>
                    <url>{$API.URL}/redfish/v1/Systems/Self</url>
                </item>
            </items>
            <discovery_rules>
                <discovery_rule>
                    <name>Drives Discovery</name>
                    <type>DEPENDENT</type>
                    <key>graviton.drives.discovery</key>
                    <delay>0</delay>
                    <filter>
                        <conditions>
                            <condition>
                                <macro>{#STATE}</macro>
                                <value>Absent</value>
                                <operator>NOT_MATCHES_REGEX</operator>
                                <formulaid>A</formulaid>
                            </condition>
                        </conditions>
                    </filter>
                    <item_prototypes>
                        <item_prototype>
                            <name>Drive [{#STORAGE_UNIT}:{#NAME}] CapacityBytes</name>
                            <type>DEPENDENT</type>
                            <key>graviton.drive.capacity_bytes[{#STORAGE_UNIT},{#NAME}]</key>
                            <delay>0</delay>
                            <units>b</units>
                            <applications>
                                <application>
                                    <name>disk_drives</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}'&amp;&amp;@.StorageUnit=='{#STORAGE_UNIT}')].CapacityBytes.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.drives</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{change()}&lt;&gt;0</expression>
                                    <name>Capacity of drive {#NAME} on storage unit {#STORAGE_UNIT} was changed was changed to [{ITEM.VALUE}B]</name>
                                    <priority>INFO</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>disk_drives</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                        <item_prototype>
                            <name>Drive [{#STORAGE_UNIT}:{#NAME}] Health</name>
                            <type>DEPENDENT</type>
                            <key>graviton.drive.health[{#STORAGE_UNIT},{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>disk_drives</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}'&amp;&amp;@.StorageUnit=='{#STORAGE_UNIT}')].Health.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.drives</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}&lt;&gt;&quot;OK&quot;</expression>
                                    <name>Health of drive {#NAME} on storage unit [{#STORAGE_UNIT}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>disk_drives</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                        <item_prototype>
                            <name>Drive [{#STORAGE_UNIT}:{#NAME}] Model</name>
                            <type>DEPENDENT</type>
                            <key>graviton.drive.model[{#STORAGE_UNIT},{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>disk_drives</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}'&amp;&amp;@.StorageUnit=='{#STORAGE_UNIT}')].Model.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.drives</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{change()}&lt;&gt;0</expression>
                                    <name>Model of drive {#NAME} on storage unit {#STORAGE_UNIT} was changed to [{ITEM.VALUE}]</name>
                                    <priority>INFO</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>disk_drives</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                        <item_prototype>
                            <name>Drive [{#STORAGE_UNIT}:{#NAME}] State</name>
                            <type>DEPENDENT</type>
                            <key>graviton.drive.state[{#STORAGE_UNIT},{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>disk_drives</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}'&amp;&amp;@.StorageUnit=='{#STORAGE_UNIT}')].State.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.drives</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}=&quot;Disabled&quot;</expression>
                                    <name>State of drive {#NAME} on storage unit [{#STORAGE_UNIT}] was changed to [Disabled]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>disk_drives</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}&lt;&gt;&quot;Enabled&quot;</expression>
                                    <name>State of drive {#NAME} on storage unit [{#STORAGE_UNIT}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>INFO</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>State of drive {#NAME} on storage unit [{#STORAGE_UNIT}] was changed to [Disabled]</name>
                                            <expression>{Graviton by HTTP:graviton.drive.state[{#STORAGE_UNIT},{#NAME}].last()}=&quot;Disabled&quot;</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>disk_drives</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                    </item_prototypes>
                    <master_item>
                        <key>graviton.sensors.drives</key>
                    </master_item>
                    <lld_macro_paths>
                        <lld_macro_path>
                            <lld_macro>{#NAME}</lld_macro>
                            <path>$.Name</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#STATE}</lld_macro>
                            <path>$.State</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#STORAGE_UNIT}</lld_macro>
                            <path>$.StorageUnit</path>
                        </lld_macro_path>
                    </lld_macro_paths>
                </discovery_rule>
                <discovery_rule>
                    <name>Ethernet Interfaces Discovery</name>
                    <type>DEPENDENT</type>
                    <key>graviton.ethernet_interfaces.discovery</key>
                    <delay>0</delay>
                    <filter>
                        <conditions>
                            <condition>
                                <macro>{#STATE}</macro>
                                <value>Absent</value>
                                <operator>NOT_MATCHES_REGEX</operator>
                                <formulaid>A</formulaid>
                            </condition>
                        </conditions>
                    </filter>
                    <item_prototypes>
                        <item_prototype>
                            <name>Ethernet Interface [{#NAME}] Health</name>
                            <type>DEPENDENT</type>
                            <key>graviton.ethernet_interface.health[{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>ethernet</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].Health.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.ethernet</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}&lt;&gt;&quot;OK&quot;</expression>
                                    <name>Health of ethernet interface [{#NAME}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>ethernet</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                        <item_prototype>
                            <name>Ethernet Interface [{#NAME}] LinkStatus</name>
                            <type>DEPENDENT</type>
                            <key>graviton.ethernet_interface.link_status[{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>ethernet</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].LinkStatus.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.ethernet</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}&lt;&gt;&quot;LinkUp&quot;</expression>
                                    <name>Link status of ethernet interface [{#NAME}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>ethernet</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                        <item_prototype>
                            <name>Ethernet Interface [{#NAME}] State</name>
                            <type>DEPENDENT</type>
                            <key>graviton.ethernet_interface.state[{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>ethernet</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].State.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.ethernet</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}=&quot;Disabled&quot;</expression>
                                    <name>State of ethernet interface [{#NAME}] was changed to [Disabled]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>ethernet</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}&lt;&gt;&quot;Enabled&quot;</expression>
                                    <name>State of ethernet interface [{#NAME}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>INFO</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>State of ethernet interface [{#NAME}] was changed to [Disabled]</name>
                                            <expression>{Graviton by HTTP:graviton.ethernet_interface.state[{#NAME}].last()}=&quot;Disabled&quot;</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>ethernet</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                    </item_prototypes>
                    <master_item>
                        <key>graviton.sensors.ethernet</key>
                    </master_item>
                    <lld_macro_paths>
                        <lld_macro_path>
                            <lld_macro>{#NAME}</lld_macro>
                            <path>$.Name</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#STATE}</lld_macro>
                            <path>$.State</path>
                        </lld_macro_path>
                    </lld_macro_paths>
                </discovery_rule>
                <discovery_rule>
                    <name>Fan Discovery</name>
                    <type>DEPENDENT</type>
                    <key>graviton.fan.discovery</key>
                    <delay>0</delay>
                    <filter>
                        <conditions>
                            <condition>
                                <macro>{#STATE}</macro>
                                <value>Absent</value>
                                <operator>NOT_MATCHES_REGEX</operator>
                                <formulaid>A</formulaid>
                            </condition>
                        </conditions>
                    </filter>
                    <item_prototypes>
                        <item_prototype>
                            <name>Fan Sensor [{#NAME}] Health</name>
                            <type>DEPENDENT</type>
                            <key>graviton.fan.health[{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>fans</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].Health.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.fans</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}=&quot;Critical&quot;</expression>
                                    <name>Health of fan sensor [{#NAME}] was changed to [Critical]</name>
                                    <priority>HIGH</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>fans</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}=&quot;Warning&quot;</expression>
                                    <name>Health of fan sensor [{#NAME}] was changed to [Warning]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>Health of fan sensor [{#NAME}] was changed to [Critical]</name>
                                            <expression>{Graviton by HTTP:graviton.fan.health[{#NAME}].last()}=&quot;Critical&quot;</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>fans</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}&lt;&gt;&quot;OK&quot;</expression>
                                    <name>Health of fan sensor [{#NAME}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>Health of fan sensor [{#NAME}] was changed to [Warning]</name>
                                            <expression>{Graviton by HTTP:graviton.fan.health[{#NAME}].last()}=&quot;Warning&quot;</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>fans</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                        <item_prototype>
                            <name>Fan [{#NAME}] RPM</name>
                            <type>DEPENDENT</type>
                            <key>graviton.fan.speed_rpm[{#NAME}]</key>
                            <delay>0</delay>
                            <units>!RPM</units>
                            <applications>
                                <application>
                                    <name>fans</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].Reading.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.fans</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}&gt;{#TR_UPPER_CRITICAL}&#13;
or&#13;
{last()}&lt;{#TR_LOWER_CRITICAL}</expression>
                                    <name>Value [{ITEM.VALUE} RPM] of fan sensor [{#NAME}] out of CRITICAL range ({#TR_LOWER_CRITICAL}-{#TR_UPPER_CRITICAL})</name>
                                    <priority>AVERAGE</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>Value [{ITEM.VALUE} RPM] of fan sensor [{#NAME}] out of FATAL range ({#TR_LOWER_FATAL}-{#TR_UPPER_FATAL})</name>
                                            <expression>{Graviton by HTTP:graviton.fan.speed_rpm[{#NAME}].last()}&gt;{#TR_UPPER_FATAL}&#13;
or&#13;
{Graviton by HTTP:graviton.fan.speed_rpm[{#NAME}].last()}&lt;{#TR_LOWER_FATAL}</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>fans</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}&gt;{#TR_UPPER_FATAL}&#13;
or&#13;
{last()}&lt;{#TR_LOWER_FATAL}</expression>
                                    <name>Value [{ITEM.VALUE} RPM] of fan sensor [{#NAME}] out of FATAL range ({#TR_LOWER_FATAL}-{#TR_UPPER_FATAL})</name>
                                    <priority>HIGH</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>fans</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}&gt;{#TR_UPPER_NON_CRITICAL}&#13;
or&#13;
{last()}&lt;{#TR_LOWER_NON_CRITICAL}</expression>
                                    <name>Value [{ITEM.VALUE} RPM] of fan sensor [{#NAME}] out of NON CRITICAL range ({#TR_LOWER_NON_CRITICAL}-{#TR_UPPER_NON_CRITICAL})</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>Value [{ITEM.VALUE} RPM] of fan sensor [{#NAME}] out of CRITICAL range ({#TR_LOWER_CRITICAL}-{#TR_UPPER_CRITICAL})</name>
                                            <expression>{Graviton by HTTP:graviton.fan.speed_rpm[{#NAME}].last()}&gt;{#TR_UPPER_CRITICAL}&#13;
or&#13;
{Graviton by HTTP:graviton.fan.speed_rpm[{#NAME}].last()}&lt;{#TR_LOWER_CRITICAL}</expression>
                                        </dependency>
                                        <dependency>
                                            <name>Value [{ITEM.VALUE} RPM] of fan sensor [{#NAME}] out of FATAL range ({#TR_LOWER_FATAL}-{#TR_UPPER_FATAL})</name>
                                            <expression>{Graviton by HTTP:graviton.fan.speed_rpm[{#NAME}].last()}&gt;{#TR_UPPER_FATAL}&#13;
or&#13;
{Graviton by HTTP:graviton.fan.speed_rpm[{#NAME}].last()}&lt;{#TR_LOWER_FATAL}</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>fans</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                        <item_prototype>
                            <name>Fan Sensor [{#NAME}] State</name>
                            <type>DEPENDENT</type>
                            <key>graviton.fan.state[{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>fans</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].State.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.fans</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}=&quot;Absent&quot;</expression>
                                    <name>State of fan sensor [{#NAME}] was changed to [Absent]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>fans</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}&lt;&gt;&quot;Enabled&quot;</expression>
                                    <name>State of fan sensor [{#NAME}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>INFO</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>State of fan sensor [{#NAME}] was changed to [Absent]</name>
                                            <expression>{Graviton by HTTP:graviton.fan.state[{#NAME}].last()}=&quot;Absent&quot;</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>fans</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                    </item_prototypes>
                    <master_item>
                        <key>graviton.sensors.fans</key>
                    </master_item>
                    <lld_macro_paths>
                        <lld_macro_path>
                            <lld_macro>{#NAME}</lld_macro>
                            <path>$.Name</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#STATE}</lld_macro>
                            <path>$.State</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#TR_LOWER_CRITICAL}</lld_macro>
                            <path>$.LowerThresholdCritical</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#TR_LOWER_FATAL}</lld_macro>
                            <path>$.LowerThresholdFatal</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#TR_LOWER_NON_CRITICAL}</lld_macro>
                            <path>$.LowerThresholdNonCritical</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#TR_UPPER_CRITICAL}</lld_macro>
                            <path>$.UpperThresholdCritical</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#TR_UPPER_FATAL}</lld_macro>
                            <path>$.UpperThresholdFatal</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#TR_UPPER_NON_CRITICAL}</lld_macro>
                            <path>$.UpperThresholdNonCritical</path>
                        </lld_macro_path>
                    </lld_macro_paths>
                    <preprocessing>
                        <step>
                            <type>JAVASCRIPT</type>
                            <params>var valueArr = JSON.parse(value);

var result = [];

for (var i in valueArr) {
  var element = valueArr[i];
  if (element[&quot;{#TR_LOWER_CRITICAL}&quot;] == &quot;&quot;) {
    element[&quot;{#TR_LOWER_CRITICAL}&quot;] = &quot;-9999999&quot;;
  }
  if (element[&quot;{#TR_LOWER_FATAL}&quot;] == &quot;&quot;) {
    element[&quot;{#TR_LOWER_FATAL}&quot;] = &quot;-9999999&quot;;
  }
  if (element[&quot;{#TR_LOWER_NON_CRITICAL}&quot;] == &quot;&quot;) {
    element[&quot;{#TR_LOWER_NON_CRITICAL}&quot;] = &quot;-9999999&quot;;
  }

  if (element[&quot;{#TR_UPPER_CRITICAL}&quot;] == &quot;&quot;) {
    element[&quot;{#TR_UPPER_CRITICAL}&quot;] = &quot;9999999&quot;;
  }
  if (element[&quot;{#TR_UPPER_FATAL}&quot;] == &quot;&quot;) {
    element[&quot;{#TR_UPPER_FATAL}&quot;] = &quot;9999999&quot;;
  }
  if (element[&quot;{#TR_UPPER_NON_CRITICAL}&quot;] == &quot;&quot;) {
    element[&quot;{#TR_UPPER_NON_CRITICAL}&quot;] = &quot;9999999&quot;;
  }

  if (element[&quot;LowerThresholdCritical&quot;] == &quot;&quot;) {
    element[&quot;LowerThresholdCritical&quot;] = &quot;-9999999&quot;;
  }
  if (element[&quot;LowerThresholdFatal&quot;] == &quot;&quot;) {
    element[&quot;LowerThresholdFatal&quot;] = &quot;-9999999&quot;;
  }
  if (element[&quot;LowerThresholdNonCritical&quot;] == &quot;&quot;) {
    element[&quot;LowerThresholdNonCritical&quot;] = &quot;-9999999&quot;;
  }

  if (element[&quot;UpperThresholdCritical&quot;] == &quot;&quot;) {
    element[&quot;UpperThresholdCritical&quot;] = &quot;9999999&quot;;
  }
  if (element[&quot;UpperThresholdFatal&quot;] == &quot;&quot;) {
    element[&quot;UpperThresholdFatal&quot;] = &quot;9999999&quot;;
  }
  if (element[&quot;UpperThresholdNonCritical&quot;] == &quot;&quot;) {
    element[&quot;UpperThresholdNonCritical&quot;] = &quot;9999999&quot;;
  }

  result.push(element);
}

return JSON.stringify(result);</params>
                        </step>
                    </preprocessing>
                </discovery_rule>
                <discovery_rule>
                    <name>Logical Volumes Discovery</name>
                    <type>DEPENDENT</type>
                    <key>graviton.logical_volumes.discovery</key>
                    <delay>0</delay>
                    <filter>
                        <conditions>
                            <condition>
                                <macro>{#STATE}</macro>
                                <value>Absent</value>
                                <operator>NOT_MATCHES_REGEX</operator>
                                <formulaid>A</formulaid>
                            </condition>
                        </conditions>
                    </filter>
                    <item_prototypes>
                        <item_prototype>
                            <name>Logical Volume [{#NAME}] CapacityBytes</name>
                            <type>DEPENDENT</type>
                            <key>graviton.logical_volume.capatity_bytes[{#NAME}]</key>
                            <delay>0</delay>
                            <units>b</units>
                            <applications>
                                <application>
                                    <name>logical_volumes</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].CapacityBytes.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.volumes</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{change()}&lt;&gt;0</expression>
                                    <name>Capacity of logical volume {#NAME} was changed to [{ITEM.VALUE} B]</name>
                                    <priority>INFO</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>logical_volumes</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                        <item_prototype>
                            <name>Logical Volume [{#NAME}] Health</name>
                            <type>DEPENDENT</type>
                            <key>graviton.logical_volume.health[{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>logical_volumes</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].Health.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.volumes</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}&lt;&gt;&quot;OK&quot;</expression>
                                    <name>Health of logical volume [{#NAME}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>logical_volumes</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                        <item_prototype>
                            <name>Logical Volume [{#NAME}] State</name>
                            <type>DEPENDENT</type>
                            <key>graviton.logical_volume.state[{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>logical_volumes</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].State.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.volumes</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}=&quot;Disabled&quot;</expression>
                                    <name>State of logical volume [{#NAME}] was changed to [Disabled]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>logical_volumes</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}&lt;&gt;&quot;Enabled&quot;</expression>
                                    <name>State of logical volume [{#NAME}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>INFO</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>State of logical volume [{#NAME}] was changed to [Disabled]</name>
                                            <expression>{Graviton by HTTP:graviton.logical_volume.state[{#NAME}].last()}=&quot;Disabled&quot;</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>logical_volumes</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                    </item_prototypes>
                    <master_item>
                        <key>graviton.sensors.volumes</key>
                    </master_item>
                    <lld_macro_paths>
                        <lld_macro_path>
                            <lld_macro>{#NAME}</lld_macro>
                            <path>$.Name</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#STATE}</lld_macro>
                            <path>$.State</path>
                        </lld_macro_path>
                    </lld_macro_paths>
                </discovery_rule>
                <discovery_rule>
                    <name>Memory Discovery</name>
                    <type>DEPENDENT</type>
                    <key>graviton.memory.discovery</key>
                    <delay>0</delay>
                    <filter>
                        <conditions>
                            <condition>
                                <macro>{#STATE}</macro>
                                <value>Absent</value>
                                <operator>NOT_MATCHES_REGEX</operator>
                                <formulaid>A</formulaid>
                            </condition>
                        </conditions>
                    </filter>
                    <item_prototypes>
                        <item_prototype>
                            <name>Memory Module [{#NAME}] CapacityMiB</name>
                            <type>DEPENDENT</type>
                            <key>graviton.memory.capacity_mb[{#NAME}]</key>
                            <delay>0</delay>
                            <units>!MB</units>
                            <applications>
                                <application>
                                    <name>memory</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].CapacityMiB.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.memory</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{change()}&lt;&gt;0</expression>
                                    <name>Capacity of memory module [{#NAME}] was changed to [{ITEM.VALUE} MB]</name>
                                    <priority>INFO</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>memory</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                        <item_prototype>
                            <name>Memory Module [{#NAME}] Health</name>
                            <type>DEPENDENT</type>
                            <key>graviton.memory.health[{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>memory</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].Health.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.memory</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}&lt;&gt;&quot;OK&quot;</expression>
                                    <name>Health of memory module [{#NAME}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>memory</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                        <item_prototype>
                            <name>Memory Module [{#NAME}] State</name>
                            <type>DEPENDENT</type>
                            <key>graviton.memory.state[{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>memory</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].State.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.memory</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}=&quot;Disabled&quot;</expression>
                                    <name>State of memory module [{#NAME}] was changed to [Disabled]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>memory</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}&lt;&gt;&quot;Enabled&quot;</expression>
                                    <name>State of memory module [{#NAME}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>INFO</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>State of memory module [{#NAME}] was changed to [Disabled]</name>
                                            <expression>{Graviton by HTTP:graviton.memory.state[{#NAME}].last()}=&quot;Disabled&quot;</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>memory</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                    </item_prototypes>
                    <master_item>
                        <key>graviton.sensors.memory</key>
                    </master_item>
                    <lld_macro_paths>
                        <lld_macro_path>
                            <lld_macro>{#NAME}</lld_macro>
                            <path>$.Name</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#STATE}</lld_macro>
                            <path>$.State</path>
                        </lld_macro_path>
                    </lld_macro_paths>
                </discovery_rule>
                <discovery_rule>
                    <name>Network Adapters Discovery</name>
                    <type>DEPENDENT</type>
                    <key>graviton.net_adapters.discovery</key>
                    <delay>0</delay>
                    <item_prototypes>
                        <item_prototype>
                            <name>Network Adapter [{#NAME}] Health</name>
                            <type>DEPENDENT</type>
                            <key>graviton.net_adapter.health[{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>network_adapters</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].Health.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.net_adapters</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}&lt;&gt;&quot;OK&quot;</expression>
                                    <name>Health of network adapter [{#NAME}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>network_adapters</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                        <item_prototype>
                            <name>Network Adapter [{#NAME}] State</name>
                            <type>DEPENDENT</type>
                            <key>graviton.net_adapter.state[{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>network_adapters</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].State.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.net_adapters</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}=&quot;Disabled&quot;</expression>
                                    <name>State of network adapter [{#NAME}] was changed to [Disabled]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>network_adapters</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}&lt;&gt;&quot;Enabled&quot;</expression>
                                    <name>State of network adapter [{#NAME}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>INFO</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>State of network adapter [{#NAME}] was changed to [Disabled]</name>
                                            <expression>{Graviton by HTTP:graviton.net_adapter.state[{#NAME}].last()}=&quot;Disabled&quot;</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>network_adapters</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                    </item_prototypes>
                    <master_item>
                        <key>graviton.sensors.net_adapters</key>
                    </master_item>
                    <lld_macro_paths>
                        <lld_macro_path>
                            <lld_macro>{#NAME}</lld_macro>
                            <path>$.Name</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#STATE}</lld_macro>
                            <path>$.State</path>
                        </lld_macro_path>
                    </lld_macro_paths>
                </discovery_rule>
                <discovery_rule>
                    <name>Power Supplies Discovery</name>
                    <type>DEPENDENT</type>
                    <key>graviton.power_supplies.discovery</key>
                    <delay>0</delay>
                    <filter>
                        <conditions>
                            <condition>
                                <macro>{#STATE}</macro>
                                <value>Absent</value>
                                <operator>NOT_MATCHES_REGEX</operator>
                                <formulaid>A</formulaid>
                            </condition>
                        </conditions>
                    </filter>
                    <item_prototypes>
                        <item_prototype>
                            <name>Power Supply [{#NAME}] Fan_1 Speed</name>
                            <type>DEPENDENT</type>
                            <key>graviton.power_supplies.fan_1[{#NAME}]</key>
                            <delay>0</delay>
                            <units>!RPM</units>
                            <applications>
                                <application>
                                    <name>power_supplies</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].Fan_1.first()</params>
                                </step>
                                <step>
                                    <type>REGEX</type>
                                    <params>([0-9.,]+)
\1</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.power_supplies</key>
                            </master_item>
                        </item_prototype>
                        <item_prototype>
                            <name>Power Supply [{#NAME}] Fan_2 Speed</name>
                            <type>DEPENDENT</type>
                            <key>graviton.power_supplies.fan_2[{#NAME}]</key>
                            <delay>0</delay>
                            <units>!RPM</units>
                            <applications>
                                <application>
                                    <name>power_supplies</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].Fan_2.first()</params>
                                </step>
                                <step>
                                    <type>REGEX</type>
                                    <params>([0-9.,]+)
\1</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.power_supplies</key>
                            </master_item>
                        </item_prototype>
                        <item_prototype>
                            <name>Power Supply [{#NAME}] Health</name>
                            <type>DEPENDENT</type>
                            <key>graviton.power_supplies.health[{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>power_supplies</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].Health.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.power_supplies</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}=&quot;Critical&quot;</expression>
                                    <name>Health of power supply [{#NAME}] was changed to [Critical]</name>
                                    <priority>HIGH</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>power_supplies</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}=&quot;Warning&quot;</expression>
                                    <name>Health of power supply [{#NAME}] was changed to [Warning]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>Health of power supply [{#NAME}] was changed to [Critical]</name>
                                            <expression>{Graviton by HTTP:graviton.power_supplies.health[{#NAME}].last()}=&quot;Critical&quot;</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>power_supplies</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}&lt;&gt;&quot;Normal&quot;</expression>
                                    <name>Health of power supply [{#NAME}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>INFO</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>Health of power supply [{#NAME}] was changed to [Warning]</name>
                                            <expression>{Graviton by HTTP:graviton.power_supplies.health[{#NAME}].last()}=&quot;Warning&quot;</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>power_supplies</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                        <item_prototype>
                            <name>Power Supply [{#NAME}] LineInputCurrent</name>
                            <type>DEPENDENT</type>
                            <key>graviton.power_supplies.line_input_current[{#NAME}]</key>
                            <delay>0</delay>
                            <value_type>FLOAT</value_type>
                            <units>!A</units>
                            <applications>
                                <application>
                                    <name>power_supplies</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].LineInputCurrent.first()</params>
                                </step>
                                <step>
                                    <type>REGEX</type>
                                    <params>([0-9.,]+)
\1</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.power_supplies</key>
                            </master_item>
                        </item_prototype>
                        <item_prototype>
                            <name>Power Supply [{#NAME}] LineInputVoltage</name>
                            <type>DEPENDENT</type>
                            <key>graviton.power_supplies.line_input_voltage[{#NAME}]</key>
                            <delay>0</delay>
                            <value_type>FLOAT</value_type>
                            <units>!V</units>
                            <applications>
                                <application>
                                    <name>power_supplies</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].LineInputVoltage.first()</params>
                                </step>
                                <step>
                                    <type>REGEX</type>
                                    <params>([0-9.,]+)
\1</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.power_supplies</key>
                            </master_item>
                        </item_prototype>
                        <item_prototype>
                            <name>Power Supply [{#NAME}] LineInputWatts</name>
                            <type>DEPENDENT</type>
                            <key>graviton.power_supplies.line_input_watts[{#NAME}]</key>
                            <delay>0</delay>
                            <value_type>FLOAT</value_type>
                            <units>!W</units>
                            <applications>
                                <application>
                                    <name>power_supplies</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].LineInputWatts.first()</params>
                                </step>
                                <step>
                                    <type>REGEX</type>
                                    <params>([0-9.,]+)
\1</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.power_supplies</key>
                            </master_item>
                        </item_prototype>
                        <item_prototype>
                            <name>Power Supply [{#NAME}] PowerCapacityCurrent</name>
                            <type>DEPENDENT</type>
                            <key>graviton.power_supplies.power_capacity_current[{#NAME}]</key>
                            <delay>0</delay>
                            <value_type>FLOAT</value_type>
                            <units>!A</units>
                            <applications>
                                <application>
                                    <name>power_supplies</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].PowerCapacityCurrent.first()</params>
                                </step>
                                <step>
                                    <type>REGEX</type>
                                    <params>([0-9.,]+)
\1</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.power_supplies</key>
                            </master_item>
                        </item_prototype>
                        <item_prototype>
                            <name>Power Supply [{#NAME}] PowerCapacityVoltage</name>
                            <type>DEPENDENT</type>
                            <key>graviton.power_supplies.power_capacity_voltage[{#NAME}]</key>
                            <delay>0</delay>
                            <value_type>FLOAT</value_type>
                            <units>!V</units>
                            <applications>
                                <application>
                                    <name>power_supplies</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].PowerCapacityVoltage.first()</params>
                                </step>
                                <step>
                                    <type>REGEX</type>
                                    <params>([0-9.,]+)
\1</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.power_supplies</key>
                            </master_item>
                        </item_prototype>
                        <item_prototype>
                            <name>Power Supply [{#NAME}] PowerCapacityWatts</name>
                            <type>DEPENDENT</type>
                            <key>graviton.power_supplies.power_capacity_watts[{#NAME}]</key>
                            <delay>0</delay>
                            <value_type>FLOAT</value_type>
                            <units>!W</units>
                            <applications>
                                <application>
                                    <name>power_supplies</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].PowerCapacityWatts.first()</params>
                                </step>
                                <step>
                                    <type>REGEX</type>
                                    <params>([0-9.,]+)
\1</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.power_supplies</key>
                            </master_item>
                        </item_prototype>
                        <item_prototype>
                            <name>Power Supply [{#NAME}] PowerOutputCurrent</name>
                            <type>DEPENDENT</type>
                            <key>graviton.power_supplies.power_output_current[{#NAME}]</key>
                            <delay>0</delay>
                            <value_type>FLOAT</value_type>
                            <units>!A</units>
                            <applications>
                                <application>
                                    <name>power_supplies</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].PowerOutputCurrent.first()</params>
                                </step>
                                <step>
                                    <type>REGEX</type>
                                    <params>([0-9.,]+)
\1</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.power_supplies</key>
                            </master_item>
                        </item_prototype>
                        <item_prototype>
                            <name>Power Supply [{#NAME}] PowerOutputVoltage</name>
                            <type>DEPENDENT</type>
                            <key>graviton.power_supplies.power_output_voltage[{#NAME}]</key>
                            <delay>0</delay>
                            <value_type>FLOAT</value_type>
                            <units>!V</units>
                            <applications>
                                <application>
                                    <name>power_supplies</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].PowerOutputVoltage.first()</params>
                                </step>
                                <step>
                                    <type>REGEX</type>
                                    <params>([0-9.,]+)
\1</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.power_supplies</key>
                            </master_item>
                        </item_prototype>
                        <item_prototype>
                            <name>Power Supply [{#NAME}] PowerOutputWatts</name>
                            <type>DEPENDENT</type>
                            <key>graviton.power_supplies.power_output_watts[{#NAME}]</key>
                            <delay>0</delay>
                            <value_type>FLOAT</value_type>
                            <units>!W</units>
                            <applications>
                                <application>
                                    <name>power_supplies</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].PowerOutputWatts.first()</params>
                                </step>
                                <step>
                                    <type>REGEX</type>
                                    <params>([0-9.,]+)
\1</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.power_supplies</key>
                            </master_item>
                        </item_prototype>
                        <item_prototype>
                            <name>Power Supply [{#NAME}] State</name>
                            <type>DEPENDENT</type>
                            <key>graviton.power_supplies.state[{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>power_supplies</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].State.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.power_supplies</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}=&quot;Absent&quot;</expression>
                                    <name>State of power supply [{#NAME}] was changed to [Absent]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>power_supplies</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}&lt;&gt;&quot;Enabled&quot;</expression>
                                    <name>State of power supply [{#NAME}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>INFO</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>State of power supply [{#NAME}] was changed to [Absent]</name>
                                            <expression>{Graviton by HTTP:graviton.power_supplies.state[{#NAME}].last()}=&quot;Absent&quot;</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>power_supplies</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                        <item_prototype>
                            <name>Power Supply [{#NAME}] Temperature_1</name>
                            <type>DEPENDENT</type>
                            <key>graviton.power_supplies.temp_1[{#NAME}]</key>
                            <delay>0</delay>
                            <units>!°C</units>
                            <applications>
                                <application>
                                    <name>power_supplies</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].Temperature_1.first()</params>
                                </step>
                                <step>
                                    <type>REGEX</type>
                                    <params>([0-9.,]+)
\1</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.power_supplies</key>
                            </master_item>
                        </item_prototype>
                        <item_prototype>
                            <name>Power Supply [{#NAME}] Temperature_2</name>
                            <type>DEPENDENT</type>
                            <key>graviton.power_supplies.temp_2[{#NAME}]</key>
                            <delay>0</delay>
                            <units>!°C</units>
                            <applications>
                                <application>
                                    <name>power_supplies</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].Temperature_2.first()</params>
                                </step>
                                <step>
                                    <type>REGEX</type>
                                    <params>([0-9.,]+)
\1</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.power_supplies</key>
                            </master_item>
                        </item_prototype>
                    </item_prototypes>
                    <master_item>
                        <key>graviton.sensors.power_supplies</key>
                    </master_item>
                    <lld_macro_paths>
                        <lld_macro_path>
                            <lld_macro>{#FAN_1}</lld_macro>
                            <path>$.Fan_1</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#FAN_2}</lld_macro>
                            <path>$.Fan_2</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#LINE_INPUT_CURRENT}</lld_macro>
                            <path>$.LineInputCurrent</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#LINE_INPUT_VOLTAGE}</lld_macro>
                            <path>$.LineInputVoltage</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#LINE_INPUT_WATTS}</lld_macro>
                            <path>$.LineInputWatts</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#NAME}</lld_macro>
                            <path>$.Name</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#POWER_CAPACITY_CURRENT}</lld_macro>
                            <path>$.PowerCapacityCurrent</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#POWER_CAPACITY_VOLTAGE}</lld_macro>
                            <path>$.PowerCapacityVoltage</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#POWER_CAPACITY_WATTS}</lld_macro>
                            <path>$.PowerCapacityWatts</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#POWER_OUTPUT_CURRENT}</lld_macro>
                            <path>$.PowerOutputCurrent</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#POWER_OUTPUT_VOLTAGE}</lld_macro>
                            <path>$.PowerOutputVoltage</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#POWER_OUTPUT_WATTS}</lld_macro>
                            <path>$.PowerOutputWatts</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#STATE}</lld_macro>
                            <path>$.State</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#TEMPERATURE_1}</lld_macro>
                            <path>$.Temperature_1</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#TEMPERATURE_2}</lld_macro>
                            <path>$.Temperature_2</path>
                        </lld_macro_path>
                    </lld_macro_paths>
                    <overrides>
                        <override>
                            <name>Not Discover Fan_1</name>
                            <step>1</step>
                            <filter>
                                <conditions>
                                    <condition>
                                        <macro>{#FAN_1}</macro>
                                        <value>N\/A</value>
                                        <formulaid>A</formulaid>
                                    </condition>
                                </conditions>
                            </filter>
                            <operations>
                                <operation>
                                    <operationobject>ITEM_PROTOTYPE</operationobject>
                                    <operator>LIKE</operator>
                                    <value>Fan_1</value>
                                    <discover>NO_DISCOVER</discover>
                                </operation>
                            </operations>
                        </override>
                        <override>
                            <name>Not Discover Fan_2</name>
                            <step>2</step>
                            <filter>
                                <conditions>
                                    <condition>
                                        <macro>{#FAN_2}</macro>
                                        <value>N\/A</value>
                                        <formulaid>A</formulaid>
                                    </condition>
                                </conditions>
                            </filter>
                            <operations>
                                <operation>
                                    <operationobject>ITEM_PROTOTYPE</operationobject>
                                    <operator>LIKE</operator>
                                    <value>Fan_2</value>
                                    <discover>NO_DISCOVER</discover>
                                </operation>
                            </operations>
                        </override>
                        <override>
                            <name>Not Discover LineInputCurrent</name>
                            <step>3</step>
                            <filter>
                                <conditions>
                                    <condition>
                                        <macro>{#LINE_INPUT_CURRENT}</macro>
                                        <value>N\/A</value>
                                        <formulaid>A</formulaid>
                                    </condition>
                                </conditions>
                            </filter>
                            <operations>
                                <operation>
                                    <operationobject>ITEM_PROTOTYPE</operationobject>
                                    <operator>LIKE</operator>
                                    <value>LineInputCurrent</value>
                                    <discover>NO_DISCOVER</discover>
                                </operation>
                            </operations>
                        </override>
                        <override>
                            <name>Not Discover LineInputVoltage</name>
                            <step>4</step>
                            <filter>
                                <conditions>
                                    <condition>
                                        <macro>{#LINE_INPUT_VOLTAGE}</macro>
                                        <value>N\/A</value>
                                        <formulaid>A</formulaid>
                                    </condition>
                                </conditions>
                            </filter>
                            <operations>
                                <operation>
                                    <operationobject>ITEM_PROTOTYPE</operationobject>
                                    <operator>LIKE</operator>
                                    <value>LineInputVoltage</value>
                                    <discover>NO_DISCOVER</discover>
                                </operation>
                            </operations>
                        </override>
                        <override>
                            <name>Not Discover LineInputWatts</name>
                            <step>5</step>
                            <filter>
                                <conditions>
                                    <condition>
                                        <macro>{#LINE_INPUT_WATTS}</macro>
                                        <value>N\/A</value>
                                        <formulaid>A</formulaid>
                                    </condition>
                                </conditions>
                            </filter>
                            <operations>
                                <operation>
                                    <operationobject>ITEM_PROTOTYPE</operationobject>
                                    <operator>LIKE</operator>
                                    <value>LineInputWatts</value>
                                    <discover>NO_DISCOVER</discover>
                                </operation>
                            </operations>
                        </override>
                        <override>
                            <name>Not Discover PowerCapacityCurrent</name>
                            <step>6</step>
                            <filter>
                                <conditions>
                                    <condition>
                                        <macro>{#POWER_CAPACITY_CURRENT}</macro>
                                        <value>N\/A</value>
                                        <formulaid>A</formulaid>
                                    </condition>
                                </conditions>
                            </filter>
                            <operations>
                                <operation>
                                    <operationobject>ITEM_PROTOTYPE</operationobject>
                                    <operator>LIKE</operator>
                                    <value>PowerCapacityCurrent</value>
                                    <discover>NO_DISCOVER</discover>
                                </operation>
                            </operations>
                        </override>
                        <override>
                            <name>Not Discover PowerCapacityVoltage</name>
                            <step>7</step>
                            <filter>
                                <conditions>
                                    <condition>
                                        <macro>{#POWER_CAPACITY_VOLTAGE}</macro>
                                        <value>N\/A</value>
                                        <formulaid>A</formulaid>
                                    </condition>
                                </conditions>
                            </filter>
                            <operations>
                                <operation>
                                    <operationobject>ITEM_PROTOTYPE</operationobject>
                                    <operator>LIKE</operator>
                                    <value>PowerCapacityVoltage</value>
                                    <discover>NO_DISCOVER</discover>
                                </operation>
                            </operations>
                        </override>
                        <override>
                            <name>Not Discover PowerCapacityWatts</name>
                            <step>8</step>
                            <filter>
                                <conditions>
                                    <condition>
                                        <macro>{#POWER_CAPACITY_WATTS}</macro>
                                        <value>N\/A</value>
                                        <formulaid>A</formulaid>
                                    </condition>
                                </conditions>
                            </filter>
                            <operations>
                                <operation>
                                    <operationobject>ITEM_PROTOTYPE</operationobject>
                                    <operator>LIKE</operator>
                                    <value>PowerCapacityWatts</value>
                                    <discover>NO_DISCOVER</discover>
                                </operation>
                            </operations>
                        </override>
                        <override>
                            <name>Not Discover PowerOutputCurrent</name>
                            <step>9</step>
                            <filter>
                                <conditions>
                                    <condition>
                                        <macro>{#POWER_OUTPUT_CURRENT}</macro>
                                        <value>N\/A</value>
                                        <formulaid>A</formulaid>
                                    </condition>
                                </conditions>
                            </filter>
                            <operations>
                                <operation>
                                    <operationobject>ITEM_PROTOTYPE</operationobject>
                                    <operator>LIKE</operator>
                                    <value>PowerOutputCurrent</value>
                                    <discover>NO_DISCOVER</discover>
                                </operation>
                            </operations>
                        </override>
                        <override>
                            <name>Not Discover PowerOutputVoltage</name>
                            <step>10</step>
                            <filter>
                                <conditions>
                                    <condition>
                                        <macro>{#POWER_OUTPUT_VOLTAGE}</macro>
                                        <value>N\/A</value>
                                        <formulaid>A</formulaid>
                                    </condition>
                                </conditions>
                            </filter>
                            <operations>
                                <operation>
                                    <operationobject>ITEM_PROTOTYPE</operationobject>
                                    <operator>LIKE</operator>
                                    <value>PowerOutputVoltage</value>
                                    <discover>NO_DISCOVER</discover>
                                </operation>
                            </operations>
                        </override>
                        <override>
                            <name>Not Discover PowerOutputWatts</name>
                            <step>11</step>
                            <filter>
                                <conditions>
                                    <condition>
                                        <macro>{#POWER_OUTPUT_WATTS}</macro>
                                        <value>N\/A</value>
                                        <formulaid>A</formulaid>
                                    </condition>
                                </conditions>
                            </filter>
                            <operations>
                                <operation>
                                    <operationobject>ITEM_PROTOTYPE</operationobject>
                                    <operator>LIKE</operator>
                                    <value>PowerOutputWatts</value>
                                    <discover>NO_DISCOVER</discover>
                                </operation>
                            </operations>
                        </override>
                        <override>
                            <name>Not Discover Temperature_1</name>
                            <step>12</step>
                            <filter>
                                <conditions>
                                    <condition>
                                        <macro>{#TEMPERATURE_1}</macro>
                                        <value>N\/A</value>
                                        <formulaid>A</formulaid>
                                    </condition>
                                </conditions>
                            </filter>
                            <operations>
                                <operation>
                                    <operationobject>ITEM_PROTOTYPE</operationobject>
                                    <operator>LIKE</operator>
                                    <value>Temperature_1</value>
                                    <discover>NO_DISCOVER</discover>
                                </operation>
                            </operations>
                        </override>
                        <override>
                            <name>Not Discover Temperature_2</name>
                            <step>13</step>
                            <filter>
                                <conditions>
                                    <condition>
                                        <macro>{#TEMPERATURE_2}</macro>
                                        <value>N\/A</value>
                                        <formulaid>A</formulaid>
                                    </condition>
                                </conditions>
                            </filter>
                            <operations>
                                <operation>
                                    <operationobject>ITEM_PROTOTYPE</operationobject>
                                    <operator>LIKE</operator>
                                    <value>Temperature_2</value>
                                    <discover>NO_DISCOVER</discover>
                                </operation>
                            </operations>
                        </override>
                    </overrides>
                </discovery_rule>
                <discovery_rule>
                    <name>Processors Discovery</name>
                    <type>DEPENDENT</type>
                    <key>graviton.processors.discovery</key>
                    <delay>0</delay>
                    <filter>
                        <conditions>
                            <condition>
                                <macro>{#STATE}</macro>
                                <value>Absent</value>
                                <operator>NOT_MATCHES_REGEX</operator>
                                <formulaid>A</formulaid>
                            </condition>
                        </conditions>
                    </filter>
                    <item_prototypes>
                        <item_prototype>
                            <name>Processor [{#NAME}] TotalCores</name>
                            <type>DEPENDENT</type>
                            <key>graviton.processors.cores[{#NAME}]</key>
                            <delay>0</delay>
                            <units>!cores</units>
                            <applications>
                                <application>
                                    <name>processors</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].TotalCores.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.processors</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{change()}=1</expression>
                                    <name>Number of cores of processor [{#NAME}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>INFO</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>processors</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                        <item_prototype>
                            <name>Processor [{#NAME}] Health</name>
                            <type>DEPENDENT</type>
                            <key>graviton.processors.health[{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>processors</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].Health.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.processors</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}&lt;&gt;&quot;OK&quot;</expression>
                                    <name>Health of processor [{#NAME}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>processors</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                        <item_prototype>
                            <name>Processor [{#NAME}] Model</name>
                            <type>DEPENDENT</type>
                            <key>graviton.processors.model[{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>processors</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].Model.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.processors</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{change()}=1</expression>
                                    <name>Model of processor [{#NAME}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>processors</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                        <item_prototype>
                            <name>Processor [{#NAME}] State</name>
                            <type>DEPENDENT</type>
                            <key>graviton.processors.state[{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>processors</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].State.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.processors</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}=&quot;Absent&quot;</expression>
                                    <name>State of processor [{#NAME}] was changed to [Absent]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>processors</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}&lt;&gt;&quot;Enabled&quot;</expression>
                                    <name>State of processor [{#NAME}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>INFO</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>State of processor [{#NAME}] was changed to [Absent]</name>
                                            <expression>{Graviton by HTTP:graviton.processors.state[{#NAME}].last()}=&quot;Absent&quot;</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>processors</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                        <item_prototype>
                            <name>Processor [{#NAME}] TotalThreads</name>
                            <type>DEPENDENT</type>
                            <key>graviton.processors.threads[{#NAME}]</key>
                            <delay>0</delay>
                            <units>!threads</units>
                            <applications>
                                <application>
                                    <name>processors</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].TotalThreads.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.processors</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{change()}=1</expression>
                                    <name>Number of threads of processor [{#NAME}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>INFO</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>processors</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                    </item_prototypes>
                    <master_item>
                        <key>graviton.sensors.processors</key>
                    </master_item>
                    <lld_macro_paths>
                        <lld_macro_path>
                            <lld_macro>{#NAME}</lld_macro>
                            <path>$.Name</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#STATE}</lld_macro>
                            <path>$.State</path>
                        </lld_macro_path>
                    </lld_macro_paths>
                </discovery_rule>
                <discovery_rule>
                    <name>Storage Controllers Discovery</name>
                    <type>DEPENDENT</type>
                    <key>graviton.storage_controllers.discovery</key>
                    <delay>0</delay>
                    <filter>
                        <conditions>
                            <condition>
                                <macro>{#STATE}</macro>
                                <value>Absent</value>
                                <operator>NOT_MATCHES_REGEX</operator>
                                <formulaid>A</formulaid>
                            </condition>
                        </conditions>
                    </filter>
                    <item_prototypes>
                        <item_prototype>
                            <name>Storage Controller [{#NAME}] Health</name>
                            <type>DEPENDENT</type>
                            <key>graviton.storage_controller.health[{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>storage_controllers</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].Health.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.storage_controllers</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}&lt;&gt;&quot;OK&quot;</expression>
                                    <name>Health of storage controller [{#NAME}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>storage_controllers</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                        <item_prototype>
                            <name>Storage Controller [{#NAME}] State</name>
                            <type>DEPENDENT</type>
                            <key>graviton.storage_controller.state[{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>storage_controllers</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].State.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.storage_controllers</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}=&quot;Disabled&quot;</expression>
                                    <name>State of storage controller [{#NAME}] was changed to [Disabled]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>storage_controllers</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}&lt;&gt;&quot;Enabled&quot;</expression>
                                    <name>State of storage controller [{#NAME}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>INFO</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>State of storage controller [{#NAME}] was changed to [Disabled]</name>
                                            <expression>{Graviton by HTTP:graviton.storage_controller.state[{#NAME}].last()}=&quot;Disabled&quot;</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>storage_controllers</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                    </item_prototypes>
                    <master_item>
                        <key>graviton.sensors.storage_controllers</key>
                    </master_item>
                    <lld_macro_paths>
                        <lld_macro_path>
                            <lld_macro>{#NAME}</lld_macro>
                            <path>$.Name</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#STATE}</lld_macro>
                            <path>$.State</path>
                        </lld_macro_path>
                    </lld_macro_paths>
                </discovery_rule>
                <discovery_rule>
                    <name>Temperature Discovery</name>
                    <type>DEPENDENT</type>
                    <key>graviton.temp.discovery</key>
                    <delay>0</delay>
                    <filter>
                        <conditions>
                            <condition>
                                <macro>{#STATE}</macro>
                                <value>Absent</value>
                                <operator>NOT_MATCHES_REGEX</operator>
                                <formulaid>A</formulaid>
                            </condition>
                        </conditions>
                    </filter>
                    <item_prototypes>
                        <item_prototype>
                            <name>Temperature Sensor [{#NAME}] Health</name>
                            <type>DEPENDENT</type>
                            <key>graviton.temp.health[{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>temperature</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].Health.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.temp</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}=&quot;Critical&quot;</expression>
                                    <name>Health of temperature sensor [{#NAME}] was changed to [Critical]</name>
                                    <priority>HIGH</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>temperature</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}=&quot;Warning&quot;</expression>
                                    <name>Health of temperature sensor [{#NAME}] was changed to [Warning]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>Health of temperature sensor [{#NAME}] was changed to [Critical]</name>
                                            <expression>{Graviton by HTTP:graviton.temp.health[{#NAME}].last()}=&quot;Critical&quot;</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>temperature</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}&lt;&gt;&quot;OK&quot;</expression>
                                    <name>Health of temperature sensor [{#NAME}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>INFO</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>Health of temperature sensor [{#NAME}] was changed to [Warning]</name>
                                            <expression>{Graviton by HTTP:graviton.temp.health[{#NAME}].last()}=&quot;Warning&quot;</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>temperature</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                        <item_prototype>
                            <name>Temperature Sensor [{#NAME}] ReadingCelsius</name>
                            <type>DEPENDENT</type>
                            <key>graviton.temp.reading_celsius[{#NAME}]</key>
                            <delay>0</delay>
                            <value_type>FLOAT</value_type>
                            <units>!°C</units>
                            <applications>
                                <application>
                                    <name>temperature</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].ReadingCelsius.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.temp</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}&gt;{#TR_UPPER_CRITICAL}&#13;
or&#13;
{last()}&lt;{#TR_LOWER_CRITICAL}</expression>
                                    <name>Value [{ITEM.VALUE}°C] of temperature sensor [{#NAME}] out of CRITICAL range ({#TR_LOWER_CRITICAL}-{#TR_UPPER_CRITICAL})</name>
                                    <priority>AVERAGE</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>Value [{ITEM.VALUE}°C] of temperature sensor [{#NAME}] out of FATAL range ({#TR_LOWER_FATAL}-{#TR_UPPER_FATAL})</name>
                                            <expression>{Graviton by HTTP:graviton.temp.reading_celsius[{#NAME}].last()}&gt;{#TR_UPPER_FATAL}&#13;
or&#13;
{Graviton by HTTP:graviton.temp.reading_celsius[{#NAME}].last()}&lt;{#TR_LOWER_FATAL}</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>temperature</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}&gt;{#TR_UPPER_FATAL}&#13;
or&#13;
{last()}&lt;{#TR_LOWER_FATAL}</expression>
                                    <name>Value [{ITEM.VALUE}°C] of temperature sensor [{#NAME}] out of FATAL range ({#TR_LOWER_FATAL}-{#TR_UPPER_FATAL})</name>
                                    <priority>HIGH</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>temperature</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}&gt;{#TR_UPPER_NON_CRITICAL}&#13;
or&#13;
{last()}&lt;{#TR_LOWER_NON_CRITICAL}</expression>
                                    <name>Value [{ITEM.VALUE}°C] of temperature sensor [{#NAME}] out of NON CRITICAL range ({#TR_LOWER_NON_CRITICAL}-{#TR_UPPER_NON_CRITICAL})</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>Value [{ITEM.VALUE}°C] of temperature sensor [{#NAME}] out of CRITICAL range ({#TR_LOWER_CRITICAL}-{#TR_UPPER_CRITICAL})</name>
                                            <expression>{Graviton by HTTP:graviton.temp.reading_celsius[{#NAME}].last()}&gt;{#TR_UPPER_CRITICAL}&#13;
or&#13;
{Graviton by HTTP:graviton.temp.reading_celsius[{#NAME}].last()}&lt;{#TR_LOWER_CRITICAL}</expression>
                                        </dependency>
                                        <dependency>
                                            <name>Value [{ITEM.VALUE}°C] of temperature sensor [{#NAME}] out of FATAL range ({#TR_LOWER_FATAL}-{#TR_UPPER_FATAL})</name>
                                            <expression>{Graviton by HTTP:graviton.temp.reading_celsius[{#NAME}].last()}&gt;{#TR_UPPER_FATAL}&#13;
or&#13;
{Graviton by HTTP:graviton.temp.reading_celsius[{#NAME}].last()}&lt;{#TR_LOWER_FATAL}</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>temperature</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                        <item_prototype>
                            <name>Temperature Sensor [{#NAME}] State</name>
                            <type>DEPENDENT</type>
                            <key>graviton.temp.state[{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>temperature</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].State.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.temp</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}=&quot;Absent&quot;</expression>
                                    <name>State of temperature sensor [{#NAME}] was changed to [Absent]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>temperature</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}&lt;&gt;&quot;Enabled&quot;</expression>
                                    <name>State of temperature sensor [{#NAME}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>INFO</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>State of temperature sensor [{#NAME}] was changed to [Absent]</name>
                                            <expression>{Graviton by HTTP:graviton.temp.state[{#NAME}].last()}=&quot;Absent&quot;</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>temperature</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                    </item_prototypes>
                    <master_item>
                        <key>graviton.sensors.temp</key>
                    </master_item>
                    <lld_macro_paths>
                        <lld_macro_path>
                            <lld_macro>{#NAME}</lld_macro>
                            <path>$.Name</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#STATE}</lld_macro>
                            <path>$.State</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#TR_LOWER_CRITICAL}</lld_macro>
                            <path>$.LowerThresholdCritical</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#TR_LOWER_FATAL}</lld_macro>
                            <path>$.LowerThresholdFatal</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#TR_LOWER_NON_CRITICAL}</lld_macro>
                            <path>$.LowerThresholdNonCritical</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#TR_UPPER_CRITICAL}</lld_macro>
                            <path>$.UpperThresholdCritical</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#TR_UPPER_FATAL}</lld_macro>
                            <path>$.UpperThresholdFatal</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#TR_UPPER_NON_CRITICAL}</lld_macro>
                            <path>$.UpperThresholdNonCritical</path>
                        </lld_macro_path>
                    </lld_macro_paths>
                    <preprocessing>
                        <step>
                            <type>JAVASCRIPT</type>
                            <params>var valueArr = JSON.parse(value);

var result = [];

for (var i in valueArr) {
  var element = valueArr[i];
  if (element[&quot;{#TR_LOWER_CRITICAL}&quot;] == &quot;&quot;) {
    element[&quot;{#TR_LOWER_CRITICAL}&quot;] = &quot;-9999999&quot;;
  }
  if (element[&quot;{#TR_LOWER_FATAL}&quot;] == &quot;&quot;) {
    element[&quot;{#TR_LOWER_FATAL}&quot;] = &quot;-9999999&quot;;
  }
  if (element[&quot;{#TR_LOWER_NON_CRITICAL}&quot;] == &quot;&quot;) {
    element[&quot;{#TR_LOWER_NON_CRITICAL}&quot;] = &quot;-9999999&quot;;
  }

  if (element[&quot;{#TR_UPPER_CRITICAL}&quot;] == &quot;&quot;) {
    element[&quot;{#TR_UPPER_CRITICAL}&quot;] = &quot;9999999&quot;;
  }
  if (element[&quot;{#TR_UPPER_FATAL}&quot;] == &quot;&quot;) {
    element[&quot;{#TR_UPPER_FATAL}&quot;] = &quot;9999999&quot;;
  }
  if (element[&quot;{#TR_UPPER_NON_CRITICAL}&quot;] == &quot;&quot;) {
    element[&quot;{#TR_UPPER_NON_CRITICAL}&quot;] = &quot;9999999&quot;;
  }

  if (element[&quot;LowerThresholdCritical&quot;] == &quot;&quot;) {
    element[&quot;LowerThresholdCritical&quot;] = &quot;-9999999&quot;;
  }
  if (element[&quot;LowerThresholdFatal&quot;] == &quot;&quot;) {
    element[&quot;LowerThresholdFatal&quot;] = &quot;-9999999&quot;;
  }
  if (element[&quot;LowerThresholdNonCritical&quot;] == &quot;&quot;) {
    element[&quot;LowerThresholdNonCritical&quot;] = &quot;-9999999&quot;;
  }

  if (element[&quot;UpperThresholdCritical&quot;] == &quot;&quot;) {
    element[&quot;UpperThresholdCritical&quot;] = &quot;9999999&quot;;
  }
  if (element[&quot;UpperThresholdFatal&quot;] == &quot;&quot;) {
    element[&quot;UpperThresholdFatal&quot;] = &quot;9999999&quot;;
  }
  if (element[&quot;UpperThresholdNonCritical&quot;] == &quot;&quot;) {
    element[&quot;UpperThresholdNonCritical&quot;] = &quot;9999999&quot;;
  }

  result.push(element);
}

return JSON.stringify(result);</params>
                        </step>
                    </preprocessing>
                </discovery_rule>
                <discovery_rule>
                    <name>Voltage Discovery</name>
                    <type>DEPENDENT</type>
                    <key>graviton.voltage.discovery</key>
                    <delay>0</delay>
                    <filter>
                        <conditions>
                            <condition>
                                <macro>{#STATE}</macro>
                                <value>Absent</value>
                                <operator>NOT_MATCHES_REGEX</operator>
                                <formulaid>A</formulaid>
                            </condition>
                        </conditions>
                    </filter>
                    <item_prototypes>
                        <item_prototype>
                            <name>Voltage Sensor [{#NAME}] Health</name>
                            <type>DEPENDENT</type>
                            <key>graviton.voltage.health[{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>voltage</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].Health.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.voltage</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}=&quot;Critical&quot;</expression>
                                    <name>Health of voltage sensor [{#NAME}] was changed to [Critical]</name>
                                    <priority>HIGH</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>voltage</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}=&quot;Warning&quot;</expression>
                                    <name>Health of voltage sensor [{#NAME}] was changed to [Warning]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>Health of voltage sensor [{#NAME}] was changed to [Critical]</name>
                                            <expression>{Graviton by HTTP:graviton.voltage.health[{#NAME}].last()}=&quot;Critical&quot;</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>voltage</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}&lt;&gt;&quot;OK&quot;</expression>
                                    <name>Health of voltage sensor [{#NAME}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>INFO</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>Health of voltage sensor [{#NAME}] was changed to [Warning]</name>
                                            <expression>{Graviton by HTTP:graviton.voltage.health[{#NAME}].last()}=&quot;Warning&quot;</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>voltage</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                        <item_prototype>
                            <name>Voltage Sensor [{#NAME}] ReadingVolts</name>
                            <type>DEPENDENT</type>
                            <key>graviton.voltage.reading_volts[{#NAME}]</key>
                            <delay>0</delay>
                            <value_type>FLOAT</value_type>
                            <units>!V</units>
                            <applications>
                                <application>
                                    <name>voltage</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].ReadingVolts.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.voltage</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}&gt;{#TR_UPPER_CRITICAL}&#13;
or&#13;
{last()}&lt;{#TR_LOWER_CRITICAL}</expression>
                                    <name>Value [{ITEM.VALUE} V] of voltage sensor [{#NAME}] out of CRITICAL range ({#TR_LOWER_CRITICAL}-{#TR_UPPER_CRITICAL})</name>
                                    <priority>AVERAGE</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>Value [{ITEM.VALUE} V] of voltage sensor [{#NAME}] out of FATAL range ({#TR_LOWER_FATAL}-{#TR_UPPER_FATAL})</name>
                                            <expression>{Graviton by HTTP:graviton.voltage.reading_volts[{#NAME}].last()}&gt;{#TR_UPPER_FATAL}&#13;
or&#13;
{Graviton by HTTP:graviton.voltage.reading_volts[{#NAME}].last()}&lt;{#TR_LOWER_FATAL}</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>voltage</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}&gt;{#TR_UPPER_FATAL}&#13;
or&#13;
{last()}&lt;{#TR_LOWER_FATAL}</expression>
                                    <name>Value [{ITEM.VALUE} V] of voltage sensor [{#NAME}] out of FATAL range ({#TR_LOWER_FATAL}-{#TR_UPPER_FATAL})</name>
                                    <priority>HIGH</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>voltage</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}&gt;{#TR_UPPER_NON_CRITICAL}&#13;
or&#13;
{last()}&lt;{#TR_LOWER_NON_CRITICAL}</expression>
                                    <name>Value [{ITEM.VALUE} V] of voltage sensor [{#NAME}] out of NON CRITICAL range ({#TR_LOWER_NON_CRITICAL}-{#TR_UPPER_NON_CRITICAL})</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>Value [{ITEM.VALUE} V] of voltage sensor [{#NAME}] out of CRITICAL range ({#TR_LOWER_CRITICAL}-{#TR_UPPER_CRITICAL})</name>
                                            <expression>{Graviton by HTTP:graviton.voltage.reading_volts[{#NAME}].last()}&gt;{#TR_UPPER_CRITICAL}&#13;
or&#13;
{Graviton by HTTP:graviton.voltage.reading_volts[{#NAME}].last()}&lt;{#TR_LOWER_CRITICAL}</expression>
                                        </dependency>
                                        <dependency>
                                            <name>Value [{ITEM.VALUE} V] of voltage sensor [{#NAME}] out of FATAL range ({#TR_LOWER_FATAL}-{#TR_UPPER_FATAL})</name>
                                            <expression>{Graviton by HTTP:graviton.voltage.reading_volts[{#NAME}].last()}&gt;{#TR_UPPER_FATAL}&#13;
or&#13;
{Graviton by HTTP:graviton.voltage.reading_volts[{#NAME}].last()}&lt;{#TR_LOWER_FATAL}</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>voltage</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                        <item_prototype>
                            <name>Voltage Sensor [{#NAME}] State</name>
                            <type>DEPENDENT</type>
                            <key>graviton.voltage.state[{#NAME}]</key>
                            <delay>0</delay>
                            <trends>0</trends>
                            <value_type>TEXT</value_type>
                            <applications>
                                <application>
                                    <name>voltage</name>
                                </application>
                            </applications>
                            <preprocessing>
                                <step>
                                    <type>JSONPATH</type>
                                    <params>$.[?(@.Name=='{#NAME}')].State.first()</params>
                                </step>
                            </preprocessing>
                            <master_item>
                                <key>graviton.sensors.voltage</key>
                            </master_item>
                            <trigger_prototypes>
                                <trigger_prototype>
                                    <expression>{last()}=&quot;Absent&quot;</expression>
                                    <name>State of voltage sensor [{#NAME}] was changed to [Absent]</name>
                                    <priority>WARNING</priority>
                                    <manual_close>YES</manual_close>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>voltage</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                                <trigger_prototype>
                                    <expression>{last()}&lt;&gt;&quot;Enabled&quot;</expression>
                                    <name>State of voltage sensor [{#NAME}] was changed to [{ITEM.VALUE}]</name>
                                    <priority>INFO</priority>
                                    <manual_close>YES</manual_close>
                                    <dependencies>
                                        <dependency>
                                            <name>State of voltage sensor [{#NAME}] was changed to [Absent]</name>
                                            <expression>{Graviton by HTTP:graviton.voltage.state[{#NAME}].last()}=&quot;Absent&quot;</expression>
                                        </dependency>
                                    </dependencies>
                                    <tags>
                                        <tag>
                                            <tag>component</tag>
                                            <value>voltage</value>
                                        </tag>
                                    </tags>
                                </trigger_prototype>
                            </trigger_prototypes>
                        </item_prototype>
                    </item_prototypes>
                    <master_item>
                        <key>graviton.sensors.voltage</key>
                    </master_item>
                    <lld_macro_paths>
                        <lld_macro_path>
                            <lld_macro>{#NAME}</lld_macro>
                            <path>$.Name</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#STATE}</lld_macro>
                            <path>$.State</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#TR_LOWER_CRITICAL}</lld_macro>
                            <path>$.LowerThresholdCritical</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#TR_LOWER_FATAL}</lld_macro>
                            <path>$.LowerThresholdFatal</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#TR_LOWER_NON_CRITICAL}</lld_macro>
                            <path>$.LowerThresholdNonCritical</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#TR_UPPER_CRITICAL}</lld_macro>
                            <path>$.UpperThresholdCritical</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#TR_UPPER_FATAL}</lld_macro>
                            <path>$.UpperThresholdFatal</path>
                        </lld_macro_path>
                        <lld_macro_path>
                            <lld_macro>{#TR_UPPER_NON_CRITICAL}</lld_macro>
                            <path>$.UpperThresholdNonCritical</path>
                        </lld_macro_path>
                    </lld_macro_paths>
                    <preprocessing>
                        <step>
                            <type>JAVASCRIPT</type>
                            <params>var valueArr = JSON.parse(value);

var result = [];

for (var i in valueArr) {
  var element = valueArr[i];
  if (element[&quot;{#TR_LOWER_CRITICAL}&quot;] == &quot;&quot;) {
    element[&quot;{#TR_LOWER_CRITICAL}&quot;] = &quot;-9999999&quot;;
  }
  if (element[&quot;{#TR_LOWER_FATAL}&quot;] == &quot;&quot;) {
    element[&quot;{#TR_LOWER_FATAL}&quot;] = &quot;-9999999&quot;;
  }
  if (element[&quot;{#TR_LOWER_NON_CRITICAL}&quot;] == &quot;&quot;) {
    element[&quot;{#TR_LOWER_NON_CRITICAL}&quot;] = &quot;-9999999&quot;;
  }

  if (element[&quot;{#TR_UPPER_CRITICAL}&quot;] == &quot;&quot;) {
    element[&quot;{#TR_UPPER_CRITICAL}&quot;] = &quot;9999999&quot;;
  }
  if (element[&quot;{#TR_UPPER_FATAL}&quot;] == &quot;&quot;) {
    element[&quot;{#TR_UPPER_FATAL}&quot;] = &quot;9999999&quot;;
  }
  if (element[&quot;{#TR_UPPER_NON_CRITICAL}&quot;] == &quot;&quot;) {
    element[&quot;{#TR_UPPER_NON_CRITICAL}&quot;] = &quot;9999999&quot;;
  }

  if (element[&quot;LowerThresholdCritical&quot;] == &quot;&quot;) {
    element[&quot;LowerThresholdCritical&quot;] = &quot;-9999999&quot;;
  }
  if (element[&quot;LowerThresholdFatal&quot;] == &quot;&quot;) {
    element[&quot;LowerThresholdFatal&quot;] = &quot;-9999999&quot;;
  }
  if (element[&quot;LowerThresholdNonCritical&quot;] == &quot;&quot;) {
    element[&quot;LowerThresholdNonCritical&quot;] = &quot;-9999999&quot;;
  }

  if (element[&quot;UpperThresholdCritical&quot;] == &quot;&quot;) {
    element[&quot;UpperThresholdCritical&quot;] = &quot;9999999&quot;;
  }
  if (element[&quot;UpperThresholdFatal&quot;] == &quot;&quot;) {
    element[&quot;UpperThresholdFatal&quot;] = &quot;9999999&quot;;
  }
  if (element[&quot;UpperThresholdNonCritical&quot;] == &quot;&quot;) {
    element[&quot;UpperThresholdNonCritical&quot;] = &quot;9999999&quot;;
  }

  result.push(element);
}

return JSON.stringify(result);</params>
                        </step>
                    </preprocessing>
                </discovery_rule>
            </discovery_rules>
            <macros>
                <macro>
                    <macro>{$API.PASSWORD}</macro>
                    <value>&lt;password&gt;</value>
                    <description>GRAVITON Redfish user password.</description>
                </macro>
                <macro>
                    <macro>{$API.URL}</macro>
                    <value>https://&lt;host&gt;:&lt;port&gt;</value>
                    <description>GRAVITON Redfish API URL in the format `&lt;scheme&gt;://&lt;host&gt;:&lt;port&gt;`.</description>
                </macro>
                <macro>
                    <macro>{$API.USER}</macro>
                    <value>&lt;username&gt;</value>
                    <description>GRAVITON Redfish username.</description>
                </macro>
            </macros>
        </template>
    </templates>
</zabbix_export>
